Sunday, 12 April 2015

SADD key value1 value2 ... valueN

Syntax
SADD key value1 value2 ... valueN
    Set is a data structure, it don't allow duplicae elements. SADD command add elements to the set, duplicate elements are ignored while adding.

Returns
Number of elements addedd to the set.
127.0.0.1:6379> sadd set1 1 2 3 4 5 
(integer) 5 
127.0.0.1:6379> sadd set1 4 5 6 7 8 
(integer) 3 
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> 

 
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment