Sunday, 12 April 2015

SISMEMBER key member : Check member existence

Syntax
SISMEMBER key member
   Returns 1 if the element is a member of the set.
   Returns 0 if the element is not a member of the set (or) key doesn't exist.

127.0.0.1:6379> smembers set1 
1) "1" 
2) "2" 
3) "3" 
4) "4" 
5) "5" 
6) "6" 
7) "7" 
8) "8" 
127.0.0.1:6379> sismember set1 5 
(integer) 1 
127.0.0.1:6379> sismember set1 55 
(integer) 0 
127.0.0.1:6379> sismember set2 55 
(integer) 0 

 
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment