MSET

Since 1.1.0Strings

Syntax

MSET key value [key value ...]
  • Flags: write
  • ACL categories: @slow, @string, @write
  • Arity: -3

Sets several keys to string values in one step. Existing values are replaced, and their expiries removed.

Reply

  • OK; MSET does not fail for a key's existing value or type.
  • A wrong-number-of-arguments error if the keys and values do not pair up.

Examples

> MSET a 1 b 2
OK
> MGET a b
1) "1"
2) "2"