HMSET(3valkey)

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

πŸ’– HMSET β€” the valkey command manual, but make it a group chat πŸ’–

okay so bestie, you're in the Valkey Command Manual and today's main character is HMSET. let's get into it 🫢


✨ NAME ✨

hmset β€” sets the values of multiple fields. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

HMSET key field value [field value ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea πŸ“: HMSET sets the specified fields to their respective values in the hash stored at key. Basically you hand her a lil shopping list of field-value pairs and she just... does them all. no drama.

She overwrites any specified fields that already exist in the hash. like, sorry not sorry, the old value is gone, that's just the vibe. πŸ”₯

And if key doesn't exist? no worries queen, a brand new key holding a hash gets created for you. she's literally building it from scratch, main character energy fr fr πŸ‘‘

πŸŽ€ Alternative πŸŽ€

HSET with multiple field-value pairs. same energy, newer name, iykyk ✨


πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Simple string reply: OK.

(just OK. she's a girl of few words and honestly? iconic.)


⭐ COMPLEXITY ⭐

O(N) where N is the number of fields being set.

translation: the more fields you throw at her, the more work it is. no cap.


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@fast @hash @write


🌈 HISTORY 🌈

  • Available since: 2.0.0 β€” she's been slaying since day one, a true veteran πŸ’œ

πŸ’… EXAMPLES πŸ’…

127.0.0.1:6379> HMSET myhash field1 "Hello" field2 "World"
OK
127.0.0.1:6379> HGET myhash field1
"Hello"
127.0.0.1:6379> HGET myhash field2
"World"

see how she set two fields in one go and then HGET pulled them right back out? obsessed. ate and left no crumbs 🧚


πŸ” SEE ALSO πŸ”


okay that's the whole page bestie, go forth and set those fields πŸ’–βœ¨

mwah πŸ’‹ this was version 9.0.0, dated 2025-10-21, and it's your girl HMSET(3valkey) signing off β€” stay hydrated, read your manpages, and don't forget to HGET what you HMSET πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from