ZDIFFSTORE

Syntax
ZDIFFSTORE destination numkeys key [key ...]
Available since:
6.2.0
Time complexity:
O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set.
ACL categories:
@write, @sortedset, @slow,

计算第一个和所有后续输入排序集合之间的差异,并将结果存储在destination中。输入键的总数由numkeys指定。

不存在的键被视为空集。

如果 destination 已经存在,它将被覆盖。

示例

ZADD zset1 1 "one" ZADD zset1 2 "two" ZADD zset1 3 "three" ZADD zset2 1 "one" ZADD zset2 2 "two" ZDIFFSTORE out 2 zset1 zset2 ZRANGE out 0 -1 WITHSCORES

RESP2/RESP3 回复

Integer reply: the number of members in the resulting sorted set at destination.
RATE THIS PAGE
Back to top ↑