Latest web development tutorials

Redis Discard command

Redis transaction

Redis Discard command is used to cancel the transaction, give up all the commands within a transaction block.

grammar

redis Discard basic command syntax is as follows:

redis 127.0.0.1:6379> DISCARD

Available versions

> = 2.0.0

return value

Always returns OK.

Examples

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 transaction