Saturday 11 April 2015

MSETNX key value


Syntax
MSETNX key1 value1 key2 value2 ... keyN valueN
    Sets keys to values if key is not exist. It will not perform any operation at all even if just a single key already exists.

Returns
1 if the all the keys were set.
0 if no key set.

127.0.0.1:6379> msetnx x 10 y 11 z 12 
(integer) 1 
127.0.0.1:6379> msetnx b 11 x 12 
(integer) 0 
127.0.0.1:6379> mget x y z  b 
1) "10" 
2) "11" 
3) "12" 
4) (nil) 

Prevoius                                                 Next                                                 Home

No comments:

Post a Comment