HSCAN(3valkey)
πΈ HSCAN (from the valkey command manual, bestie) πΈ
β¨ NAME β¨
hscan β it iterates over fields and values of a hash. That's it, that's the whole job, and she does it flawlessly π
π¦ SYNOPSIS π¦
HSCAN key cursor [MATCH pattern] [COUNT count] [NOVALUES]
Real talk: if you want the actual HSCAN documentation, go read valkey-scan(7) SCAN. Like, the SCAN page. It's all there, iykyk π«Ά
π REPLY π
You get a valkey-protocol(7) Array reply back β a two-element array, periodt. And here's what's inside:
- The first element is a
valkey-protocol(7)Bulk string reply that represents an unsigned 64-bit number β that's your cursor, bestie π’ - The second element is a
valkey-protocol(7)Array reply of the field/value pairs that got scanned. But wait β when theNOVALUESoption is on, it's a list of keys from the hash instead π
π₯ COMPLEXITY π₯
- O(1) for every single call. Every one. Snappy.
- O(N) for a complete iteration β and that includes enough command calls for the cursor to come all the way back to
0. N is the number of elements inside the collection, no cap π
π ACL CATEGORIES π
@hash @read @slow
π HISTORY π
- Available since: 2.8.0 β she's been iconic since day one, fr fr β¨
π SEE ALSO π
hdel(3valkey), hexists(3valkey), hexpire(3valkey), hexpireat(3valkey), hexpiretime(3valkey), hget(3valkey), hgetall(3valkey), hgetex(3valkey), hincrby(3valkey), hincrbyfloat(3valkey), hkeys(3valkey), hlen(3valkey), hmget(3valkey), hmset(3valkey), hpersist(3valkey), hpexpire(3valkey), hpexpireat(3valkey), hpexpiretime(3valkey), hpttl(3valkey), hrandfield(3valkey), hset(3valkey), hsetex(3valkey), hsetnx(3valkey), hstrlen(3valkey), httl(3valkey), hvals(3valkey)
Okay that's the whole page, you ate it up π This was 9.0.0, dated 2025-10-21 β mwah, go scan some hashes, main character π§π
π¦ 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