HKEYS(3valkey)
β¨ 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:
hdel(3valkey)hexists(3valkey)hexpire(3valkey)hexpireat(3valkey)hexpiretime(3valkey)hget(3valkey)hgetall(3valkey)hgetex(3valkey)hincrby(3valkey)hincrbyfloat(3valkey)hlen(3valkey)hmget(3valkey)hmset(3valkey)hpersist(3valkey)hpexpire(3valkey)hpexpireat(3valkey)hpexpiretime(3valkey)hpttl(3valkey)hrandfield(3valkey)hscan(3valkey)hset(3valkey)hsetex(3valkey)hsetnx(3valkey)hstrlen(3valkey)httl(3valkey)hvals(3valkey)
ok that's the whole page bestie, go get those field names π β¨
sign-off: this was Valkey version9.0.0, dated2025-10-21. 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