Redis SINTERSTORE 命令在所有指定集合相交之后将元素存储在集合中,不存在的键被认为是空集,如果其中一个键为空集,则输出集也为空。
SINTERSTORE - 返回值
返回元素数量。
SINTERSTORE - 语法
以下是Redis SINTERSTORE 命令的基本语法。
redis 127.0.0.1:6379> SINTERSTORE DESTINATION_KEY KEY KEY1..KEYN
SINTERSTORE - 示例
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 "Learnfk" (integer) 1 redis 127.0.0.1:6379> SINTERSTORE myset myset1 myset2 (integer) 1 redis 127.0.0.1:6379> SMEMBERS myset 1) "hello"
参考链接
https://www.learnfk.com/redis/sets-sinterstore.html
标签:127.0,0.1,SINTERSTORE,redis,无涯,6379,integer,Redis From: https://blog.51cto.com/u_14033984/9148203