ZDIFFSTORE

语法
ZDIFFSTORE destination numkeys key [key ...]
从以下位置开始可用:
6.2.0
时间复杂度:
O(L + (N-K)log(N)) 最坏情况,其中 L 是所有集合中的元素总数,N 是第一个集合的大小,K 是结果集的大小。
ACL 类别:
@write, @sortedset, @slow,

计算第一个和所有连续输入排序集之间的差值 并将结果存储在destination.输入键的总数为 指定者numkeys.

不存在的键被视为空集。

如果destinationalready exists,则它将被覆盖。

例子

redis> ZADD zset1 1 “一”
Failed to fetch
redis> ZADD zset1 2 “二”
Failed to fetch
redis> ZADD zset1 3 “三”
Failed to fetch
redis> ZADD zset2 1 “一”
Failed to fetch
redis> ZADD zset2 2 “二”
Failed to fetch
redis> ZDIFFSTORE out 2 zset1 zset2
Failed to fetch
redis> ZRANGE 出局 0 -1 WITHSCORES
Failed to fetch
redis>

RESP2/RESP3 回复

Integer reply目标处生成的排序集中的成员数。
为本页评分
返回顶部 ↑