Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Watch command

Redis Watch command

Redis Transactions

The Redis Watch command is used to monitor one (or more) key. If this (or these) 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 Version

= 2.2.0

Return Value

Always returns OK.

Example



redis> WATCH lock lock_times

OK

Redis Transactions