English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Watch Command

Redis Transactions

The Redis Watch command is used to monitor one (or more) key, if this (or these) key is modified by other commands before the transaction is executed, then 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 .

Online Examples

redis> WATCH lock lock_times
OK

Redis Transactions