SSCAN(3valkey)
β¨ SSCAN (aka the glow-up guide from the valkey manual, bestie) β¨
okay so real talk, we're in the Valkey Command Manual and today's main character is sscan π
π NAME π
sscan β it iterates over members of a set. that's it, that's the whole job, and it does it flawlessly β¨
πΈ SYNOPSIS πΈ
SSCAN key cursor [MATCH pattern] [COUNT count]
ngl bestie, this page is short on purpose: See SCAN for SSCAN documentation. the full lore lives over there, go read it, iykyk π«Ά
π REPLY π
so when you call this, valkey-protocol(7) hands you back an Array reply π β and specifically, an array with exactly two elements:
- the first element is a
valkey-protocol(7)Bulk string reply that represents an unsigned 64-bit number β that's your cursor, bestie, hold onto it π«΄ - the second element is a
valkey-protocol(7)Array reply with the names of the scanned members π
π¦ COMPLEXITY π¦
O(1)for every single call β like, per-call it's basically free πΈO(N)for a complete iteration, including enough command calls for the cursor to return back to0π- and
Nhere is the number of elements inside the collection, no cap π
π ACL CATEGORIES π
@read @set @slow
three little tags, all iconic, all necessary π
β HISTORY β
- Available since:
2.8.0β yeah she's been around a minute, a true veteran π«‘
π SEE ALSO π
the whole squad, fr fr β go show them love too:
sadd(3valkey)scard(3valkey)sdiff(3valkey)sdiffstore(3valkey)sinter(3valkey)sintercard(3valkey)sinterstore(3valkey)sismember(3valkey)smembers(3valkey)smismember(3valkey)smove(3valkey)spop(3valkey)srandmember(3valkey)srem(3valkey)sunion(3valkey)sunionstore(3valkey)
and that's the whole page bestie, tysm for reading, you ate π this was brought to you by version 9.0.0, dated 2025-10-21 β go forth and SSCAN responsibly, mwah ππβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms