SSCAN(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ 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 to 0 πŸ”
  • and N here 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:


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