HKEYS(3valkey)

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

✨ HKEYS β€” the valkey girlies' guide ✨

okay so bestie, we're in the Valkey Command Manual and today's main character is hkeys. it's giving "tell me everyone's names" energy πŸ’…


🌸 NAME 🌸

hkeys β€” returns all fields in a hash. that's it. that's the whole job. iconic. πŸŽ€


πŸ’– SYNOPSIS πŸ’–

HKEYS key

one argument. no chaos. we love a low-maintenance queen. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: it returns all the field names in the hash that lives at key. not the values, bestie β€” just the names. it's the guest list, not the gifts. 🫢


πŸ“¬ REPLY πŸ“¬

valkey-protocol(7) Array reply: a list of the fields in the hash. and if the key doesn't even exist? you get an empty list. no error, no drama, just vibes. πŸ’œ


🧠 COMPLEXITY 🧠

O(N) where N is the size of the hash. so like, the bigger the hash, the more it's gonna be walking around. still slay, just know what you're asking for. πŸ”₯


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @hash
  • @read
  • @slow

three little tags and she's certified. periodt. πŸ’…


πŸ“œ HISTORY πŸ“œ

  • Available since: 2.0.0 β€” an elder. a legend. been here since forever and still ate. πŸ‘‘

🌈 EXAMPLES 🌈

ok watch this, it's so clean:

127.0.0.1:6379> HSET myhash field1 "Hello"
(integer) 1
127.0.0.1:6379> HSET myhash field2 "World"
(integer) 1
127.0.0.1:6379> HKEYS myhash
1) "field1"
2) "field2"

see?? we put two fields in, and HKEYS handed back exactly their names, numbered and everything. no notes. πŸ’–


πŸ”— SEE ALSO πŸ”—

the whole friend group, fr fr:


ok that's the whole page bestie, go get those field names πŸ’…βœ¨

sign-off: this was Valkey version 9.0.0, dated 2025-10-21. mwah. πŸŽ€πŸ¦‹πŸ’–
πŸ“¦ where this page comes from