WATCH(3valkey)

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

πŸ’… WATCH (3valkey) β€” the valkey command manual, bestie edition ✨

okay so you found the WATCH page, welcome to the group chat 🫢 this one lives in the Valkey Command Manual, and honestly? it's giving gatekeeper of your transactions. let's get into it.


✨ NAME ✨

watch β€” keeps an eye on your keys so it can decide whether a transaction actually gets to run. like a bouncer but for EXEC. πŸ‘‘


🌸 SYNOPSIS 🌸

WATCH key [key...]

πŸ’– DESCRIPTION πŸ’–

so basically, WATCH marks the keys you hand it as watched β€” and those watched keys are what decide whether a transaction gets to execute conditionally. it's the "hey, keep watching this, i'm about to do something and i need to know if anyone messes with it" of it all. πŸ’…


πŸ¦‹ REPLY πŸ¦‹

per valkey-protocol(7), you get back a Simple string reply: OK. that's it, that's the reply. short, sweet, iconic. ✨


πŸŽ€ COMPLEXITY πŸŽ€

O(1) for every key. so, like, one per key, no matter what. ate. πŸ”₯


πŸ’œ ACL CATEGORIES πŸ’œ

  • @fast
  • @transaction

🌈 HISTORY 🌈

  • Available since: 2.2.0 β€” yeah, she's been here a minute, lowkey a legend. πŸ‘‘

🫢 SEE ALSO 🫢

the whole transaction bestie squad, fr fr. go read them together, iykyk. πŸ’–


ngl if you're running a transaction without knowing these four, you're not the main character of your own data integrity. no cap. 😭

and that's the page!! πŸŽ€ this was the 9.0.0 version, dated 2025-10-21 β€” mwah, periodt, go watch some keys bestie πŸ’…βœ¨πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from