MSET

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Set

mset stores multiple values at once.
Usage is mset key1 value1 key2 value2.

Example

Command>mset key1 Hello key2 Redis
Result>OK
Command>get key1
Result>Hello
Command>get key2
Result>Redis

View animation

Note The mset command is atomic. It never stores only some keys or fails partially.


Syntax

MSET key value [key value ...]

  • Available since version 1.0.1.
  • Time complexity is O(N).
Related commands MSETNX, MGET
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< PSETEX MSET MGET >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.