Redis Watch Command

Redis Transactions

The Redis Watch command is used to watch one (or more) keys. If the key(s) are modified by other commands before the transaction executes, the transaction will be interrupted.

Syntax

The basic syntax of the Redis Watch command is as follows:

WATCH key [key ...]

Available Versions

>= 2.2.0

Return Value

Always returns OK.

Example

redis> WATCH lock lock_times
OK

Redis Transactions

Other Extensions