ZDIFF

Since 1.1.0Sorted sets

Syntax

ZDIFF numkeys key [key ...] [WITHSCORES]
  • Flags: movablekeys, readonly
  • ACL categories: @read, @slow, @sortedset
  • Arity: -3

Returns the members of the first sorted set that are in none of the others, with their scores if WITHSCORES is given. numkeys is how many keys follow.

Examples

> ZADD s1 1 a 2 b 3 c
(integer) 3
> ZADD s2 10 b 20 c
(integer) 2
> ZDIFF 2 s1 s2 WITHSCORES
1) "a"
2) "1"