SDIFFSTORE destination key [key …]
Time complexity: O(N) where N is the total number of elements in all given sets.
This command is equal to , but instead of returning the resulting set, it is stored in .
If destination
already exists, it is overwritten.
*Examples
redis> SADD key1 "a"
redis> SADD key1 "b"
- (integer) 1
redis> SADD key1 "c"
redis> SADD key2 "d"
redis> SADD key2 "e"
- (integer) 1
redis> SDIFFSTORE key key1 key2
redis>
- 2) "b"