Saturday, 11 April 2015

SETBIT key offset value

Syntax
SETBIT key offset value
    Sets or clears the bit at offset in the string. When key does not exist, a new string value is created.

127.0.0.1:6379> setbit var 0 1 
(integer) 0 
127.0.0.1:6379> get var 
"\x80" 
127.0.0.1:6379> setbit var 2 1 
(integer) 0 
127.0.0.1:6379> get var 
"\xa0" 
127.0.0.1:6379> setbit var 4 1 
(integer) 0 
127.0.0.1:6379> get var 
"\xa8" 
127.0.0.1:6379> setbit var 8 1 
(integer) 0 
127.0.0.1:6379> get var 
"\xa8\x80" 
127.0.0.1:6379> setbit var 10 1 
(integer) 0 
127.0.0.1:6379> get var 
"\xa8\xa0" 


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment