w3resource

Redis String: MSET key value [key value ...]

MSET key value [key value ...]

Redis MSET command is used to set multiple values to multiple keys. It replaces existing values with new values.

Syntax:

MSET key1 value1 key2 value2 .. keyN valueN 

Available since

1.0.1.

Return Value

Simple string reply OK

Return Value Type

String

Example: Redis MSET

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"

Previous: STRLEN
Next: MSETNX



Follow us on Facebook and Twitter for latest update.