sincecutoff.com
← all changes

Redis SUNIONCARD returns set-union cardinality

Introduced 2026-07-29 · score 0.97

HOW TO USE IT

When you need the number of distinct members across multiple Redis sets, run `SUNIONCARD` with the number of keys followed by the set keys.

SUNIONCARD 2 <set-key-1> <set-key-2>

WHY THIS HELPS

Get the cardinality of the union of multiple Redis sets.

REQUIREMENTS AND LIMITATIONS

  • Version: 8.10.0
  • numkeys (required): Number of set keys that follow.
  • key [key ...] (required): One or more set keys to union; missing keys count as empty sets.
  • APPROX: Return an approximate cardinality instead of an exact count.
  • LIMIT limit: Stop counting at this cardinality; 0 (the default) means unlimited. Works in exact and approximate modes.
  • Prerequisite: Available since Redis Open Source 8.10.0.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card