SSCAN

SSCAN key cursor [MATCH pattern] [COUNT count]
Available since:
Redis Open Source 2.8.0
Time complexity:
O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.
ACL categories:
@read, @set, @slow,
Compatibility:
Redis Software and Redis Cloud compatibility

See SCAN for SSCAN documentation.

Required arguments

key

The name of the key that holds the set.

cursor

The cursor value. Start an iteration with 0, then use the cursor returned by each call as the argument to the next call.

Optional arguments

MATCH pattern

Only return members matching the given glob-style pattern.

COUNT count

A hint for the number of members to return per iteration. The default is 10.

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

Array reply: specifically, an array with two elements:

  • The first element is a Bulk string reply that represents an unsigned 64-bit number, the cursor.
  • The second element is an Array reply with the names of scanned members.
RATE THIS PAGE
Back to top ↑