Redis Set SINTER Command
The Redis SINTER
command returns the members of the set resulting from the intersection of all the given sets. Keys that do not exist are considered to be empty sets. With one of the keys being an empty set, the resulting set is also empty (since set intersection with an empty set always results in an empty set).
For example:
1 | key1 = {a,b,c,d} |
Syntax
The basic syntax of the SINTER
command is as follows:
1 | SINTER key [key ...] |
Available Since
Redis version >= 1.0.0
Time Complexity
O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets.
ACL Categories
@read
, @set
, @slow
Return Value
Returns a set with the members of the resulting set.
Example
1 | 127.0.0.1:6379> SADD key1 a b c d |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.