SSCAN

Since 1.1.0Sets

Syntax

SSCAN key cursor [MATCH pattern] [COUNT count]
  • Flags: readonly
  • ACL categories: @read, @set, @slow
  • Arity: -3

Goes through the members of the set at key a page at a time, as SCAN goes through keys. Start with cursor 0, and call again with the cursor each reply gives, until it gives 0.

Options

OptionEffect
MATCH patternReturn only members matching a glob-style pattern.
COUNT countHow many members to look at a call: a hint.

Reply

  • A two-element array: the next cursor, and the members of this page.

Examples

> SADD x b c d
(integer) 3
> SSCAN x 0
1) "0"
2) 1) "d"
   2) "c"
   3) "b"
> SSCAN x 0 MATCH b*
1) "0"
2) 1) "b"