Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

UNWATCH

Last updated
UNWATCH
Group
Transactions
Complexity
O(N) where N is the number of watched keys
Arity
1 (exactly, counting the command name)
Flags
fast
HotKV Cloud
All plans
On-Premise
no license needed

UNWATCH clears every key the connection watches with WATCH, so the next transaction runs unconditionally. You rarely need it after EXEC or DISCARD, which unwatch everything themselves; use it when you decide not to start the transaction after all.

Case RESP2 RESP3
Always Simple string OK Simple string OK
127.0.0.1:6379> WATCH balance
OK
127.0.0.1:6379> UNWATCH
OK

Same as Redis 7 and Valkey 8.

WATCH, MULTI, DISCARD