English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Sinter Command

Redis Sets (Set)

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

Syntax

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

redis 127.0.0.1:6379> SINTER KEY KEY1..KEYN 

Available version

>= 1.0.0

Return value

List of intersecting members.

Online Examples

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 (Set)