Abort EXEC if watched keys change before commit.

Section: Transactions and optimistic locking

Watch keys for changes

bash
bash
WATCH account:1 account:2

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Transactions and optimistic locking
Stop watching keys
Clear optimistic-lock watches.
OpenIn sheetbashsame section
Start a transaction
Queue subsequent commands for EXEC.
OpenIn sheetbashsame section
Execute queued transaction
Run all queued commands atomically.
OpenIn sheetbashsame section
Abandon queued transaction
Clear queued transaction commands.
OpenIn sheetbashsame section
Optimistic transfer transaction
Common check-and-set transaction workflow.
OpenIn sheetbashsame section
Publish a message
Send a message to all subscribers of a channel.
OpenIn sheetbash1 tag match