Easy Tutorial
❮ Keys Persist Lists Ltrim ❯

Redis Watch Command

Redis Transactions

The Redis Watch command is used to monitor one (or multiple) keys. If this (or these) keys are modified by other commands before the transaction is executed, the transaction will be interrupted.

Syntax

The basic syntax for 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

❮ Keys Persist Lists Ltrim ❯