Redis SDIFF 命令返回一个集合与给定集合的差集的元素.
SDIFF - 返回值
返回数组,结果集的元素.
SDIFF - 语法
以下是Redis SDIFF 命令的基本语法。
redis 127.0.0.1:6379> SDIFF FIRST_KEY OTHER_KEY1..OTHER_KEYN
SDIFF - 示例
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 "Learnfk" (integer) 1 redis 127.0.0.1:6379> SDIFF myset myset2 1) "foo" 2) "bar"
参考链接
https://www.learnfk.com/redis/sets-sdiff.html
标签:127.0,0.1,Redis,redis,无涯,6379,SDIFF,integer From: https://blog.51cto.com/u_14033984/9145072