Redis Discard Command

Redis Transactions

The Redis Discard command is used to cancel a transaction, abandoning the execution of all commands within the transaction block.

Syntax

The basic syntax of the Redis Discard command is as follows:

redis 127.0.0.1:6379> DISCARD

Available Versions

>= 2.0.0

Return Value

Always returns OK.

Example

redis 127.0.0.1:6379> MULTI
OK

redis 127.0.0.1:6379> PING
QUEUED

redis 127.0.0.1:6379> SET greeting "hello"
QUEUED

redis 127.0.0.1:6379> DISCARD
OK

Redis Transactions

Other Extensions