Latest web development tutorials

Redis Watch command

Redis transaction

Redis Watch command is used to monitor one (or more) key, if this (or these) key change was the implementation of other commands before the transaction, then the transaction will be interrupted

grammar

redis Watch basic command syntax is as follows:

redis 127.0.0.1:6379> Watch 

Available versions

> = 2.2.0

return value

Always returns OK.

Examples

redis> WATCH lock lock_times
OK

Redis transaction