UNWATCH
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.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Simple string OK |
Simple string OK |
Examples
Section titled “Examples”127.0.0.1:6379> WATCH balanceOK127.0.0.1:6379> UNWATCHOKCompatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.