Sunday, 12 April 2015

SUNIONSTORE destination key1 key2 ...keyN


Syntax
SUNIONSTORE destination key1 key2 ...keyN
     Stores union of all sets (key1,key2 ... keyN) to destination.


127.0.0.1:6379> sadd set1 2 4 6 8 
(integer) 4 
127.0.0.1:6379> sadd set2 1 3 5 7 4 6 
(integer) 6 
127.0.0.1:6379> sadd set3 1 3 5 7 4 
(integer) 5 
127.0.0.1:6379> sunionstore dest set1 set2 set3 
(integer) 8 
127.0.0.1:6379> smembers dest 
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