Easy Tutorial
❮ Java Environment Setup Redis Lists ❯

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 for 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

❮ Java Environment Setup Redis Lists ❯