HEXISTS(3valkey)

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

πŸ’– HEXISTS(3valkey) β€” the Valkey Command Manual, bestie edition πŸ’–

okay so bestie, welcome to hexists, from the Valkey command manual. yes it's a whole manual page, no it's not boring, sit down, hydrate, let's go 🫢


✨ NAME ✨

hexists β€” determines whether a field exists in a hash. that's it. that's the whole job. she's a yes/no girlie and she's iconic for it πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

HEXISTS key field

two little arguments, zero drama. key and field, in that order, periodt.


🌸 DESCRIPTION 🌸

so basically: this command tells you if field is an existing field in the hash stored at key. that's the vibe check. does the field live there or not. no cap. ✨

she does not return the value. she does not judge the value. she just confirms existence. main character energy of presence πŸ¦‹


πŸ’œ REPLY πŸ’œ

you get back one of these, and only these:

so it's a 0 or a 1, and that's the whole personality. 0 = not it. 1 = slay, she's there πŸ’…

heads up bestie: missing field and missing key both give you the same 0. don't come for her about it, that's just how it is πŸ™ˆ

πŸ”₯ COMPLEXITY πŸ”₯

O(1)

constant time. instant. lightning. she does not scroll, she does not search, she just knows ⭐


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @fast
  • @hash
  • @read

fast, hash-flavoured, and read-only. a respectful queen 🌈


πŸ¦‹ HISTORY πŸ¦‹

  • Available since: 2.0.0

she's been here since 2.0.0. veteran. legend. ate and left no crumbs πŸŽ€


⭐ EXAMPLES ⭐

here's her in her natural habitat:

127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
127.0.0.1:6379> HEXISTS myhash field1
(integer) 1
127.0.0.1:6379> HEXISTS myhash field2
(integer) 0

see how field1 gets a 1 and field2 gets a 0? that's the whole arc. character development, honestly πŸ˜­πŸ’–


🌈 SEE ALSO 🌈

the whole hash friend group, all of them, no one left out:


and that's the page, bestie!! πŸ’–βœ¨ this one's from Valkey version 9.0.0, dated 2025-10-21 β€” so if you're reading this, hi, ily, go check your hashes, and remember: if HEXISTS says 1, you ate. if it says 0... we move πŸ«ΆπŸŒΈπŸ’…

πŸ“¦ where this page comes from