SINTERCARD

Since 1.1.0Sets

Syntax

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

Returns how many members the intersection of the given sets has, without returning them. numkeys is how many keys follow. LIMIT limit stops counting at limit, which is faster when only a minimum matters.

Reply

  • The count.

Examples

> SADD x a b c d
(integer) 4
> SADD y c d e
(integer) 3
> SINTERCARD 2 x y
(integer) 2
> SINTERCARD 2 x y LIMIT 1
(integer) 1