Complete the code to abort a Redis transaction using the DISCARD command.
MULTI
SET key1 value1
[1]
The DISCARD command aborts the current transaction in Redis, discarding all queued commands.
Complete the code to start a transaction and then abort it properly.
MULTI
INCR counter
[1]
After starting a transaction with MULTI, DISCARD aborts it, discarding all queued commands.
Fix the error in the code to abort the transaction correctly.
MULTI SET user:1 name Alice [1]
To abort a Redis transaction, use DISCARD. EXEC or COMMIT will execute the transaction.
Fill both blanks to start a transaction and then abort it.
[1] HSET user:2 age 30 [2]
Use MULTI to start a transaction and DISCARD to abort it.
Fill all three blanks to watch a key, start a transaction, and then abort it.
[1] user:3 [2] DEL user:3 [3]
First, WATCH monitors the key, then MULTI starts the transaction, and DISCARD aborts it.