Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Mset command

Redis Mset command

Redis string

The Redis Mset command is used to set one or more key-value pairs at the same time.

Syntax

The basic syntax of the redis Mset command is as follows:



redis 127.0.0.1:6379> MSET key1 value1 key2 value2 .. keyN valueN 

Available Version

= 1.0.1

Return Value

Always returns OK.

Example



redis 127.0.0.1:6379> MSET key1 "Hello" key2 "World"

OK

redis 127.0.0.1:6379> GET key1

"Hello"

redis 127.0.0.1:6379> GET key2

1) "World"

Redis string