ZINTERCARD

Since 1.1.0Sorted sets

Syntax

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

Returns how many members the intersection of the given sorted sets has, without returning them. LIMIT limit stops counting at limit.

Examples

> ZADD s1 1 a 2 b 3 c
(integer) 3
> ZADD s2 10 b 20 c
(integer) 2
> ZINTERCARD 2 s1 s2
(integer) 2
> ZINTERCARD 2 s1 s2 LIMIT 1
(integer) 1