Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.
Josh Baker edited this page Oct 11, 2016 · 7 revisions

MSET key value [key value ...]

Sets the given keys to their respective values. MSET replaces existing values with new values, just as regular SET. See MSETNX if you don't want to overwrite existing values.

MSET is atomic, so all given keys are set at once. It is not possible for clients to see that some of the keys were updated while others are unchanged.

Return value

Simple string reply

Examples

> MSET key1 "Hello" key2 "World"
OK
> GET key1
"Hello"
> GET key2
"World"

Related Commands

APPEND, BITCOUNT, BITOP, BITPOS, DBSIZE, DECR, DECRBY, DEL, EXISTS, EXPIRE, EXPIREAT, FLUSHDB, GET, GETBIT, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, KEYS, MGET, MSET, MSETNX, PDEL, PERSIST, PEXPIRE, PEXPIREAT, PTTL, RENAME, RENAMENX, SET, SETBIT, SETRANGE, STRLEN, TTL

Clone this wiki locally