# UNWATCH

> Forget all keys watched by this connection.

URL: https://docs.hotkv.com/commands/unwatch/

```
UNWATCH
```

- Group: Transactions
- Complexity: O(N) where N is the number of watched keys
- HotKV Cloud: all plans
- On-Premise: no license needed

`UNWATCH` clears every key the connection watches with
[WATCH](https://docs.hotkv.com/commands/watch/index.md), so the next transaction runs unconditionally. You
rarely need it after [EXEC](https://docs.hotkv.com/commands/exec/index.md) or
[DISCARD](https://docs.hotkv.com/commands/discard/index.md), which unwatch everything themselves; use it
when you decide not to start the transaction after all.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Simple string `OK` | Simple string `OK` |

## Examples

```
127.0.0.1:6379> WATCH balance
OK
127.0.0.1:6379> UNWATCH
OK
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[WATCH](https://docs.hotkv.com/commands/watch/index.md), [MULTI](https://docs.hotkv.com/commands/multi/index.md),
[DISCARD](https://docs.hotkv.com/commands/discard/index.md)