Redis Sinter Command

Redis Sets

The Redis Sinter command returns the intersection of all the given sets. Non-existent set keys are treated as empty sets. When one of the given sets is empty, the result is also an empty set (according to set operation laws).

Syntax

The basic syntax of the Redis Sinter command is as follows:

redis 127.0.0.1:6379> SINTER KEY KEY1..KEYN 

Available Versions

>= 1.0.0

Return Value

List of intersection members.

Example

redis 127.0.0.1:6379> SADD myset "hello"
(integer) 1
redis 127.0.0.1:6379> SADD myset "foo"
(integer) 1
redis 127.0.0.1:6379> SADD myset "bar"
(integer) 1
redis 127.0.0.1:6379> SADD myset2 "hello"
(integer) 1
redis 127.0.0.1:6379> SADD myset2 "world"
(integer) 1
redis 127.0.0.1:6379> SINTER myset myset2
1) "hello"

Redis Sets

Other Extensions