Latest web development tutorials

RedisのSinterstoreコマンド

Redisのセット(セット)

RedisのSinterstoreコマンド指定されたコレクションに格納されたセットとの交点を与えられました。 指定されたコレクションがすでに存在する場合は上書きされます。

文法

次のようにRedisのSinterstore基本的なコマンドの構文は次のとおりです。

redis 127.0.0.1:6379> SINTERSTORE DESTINATION_KEY KEY KEY1..KEYN 

利用可能なバージョン

> = 1.0.0

戻り値

交差点リストのメンバー。

redis 127.0.0.1:6379> SADD myset1 "hello"
(integer) 1
redis 127.0.0.1:6379> SADD myset1 "foo"
(integer) 1
redis 127.0.0.1:6379> SADD myset1 "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> SINTERSTORE myset myset1 myset2
(integer) 1
redis 127.0.0.1:6379> SMEMBERS myset
1) "hello"

Redisのセット(セット)