Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Redis Transactions: DISCARD

Description

Redis DISCARD command is used to flush the all previously queued commands in a transaction and restores the connection state to normal.

If WATCH was used, DISCARD unwatches all keys watched by the connection.

Syntax:

DISCARD

Available since

2.0.0.

Return Value

Simple string reply: always OK.

Return Value Type

String

Example:

127.0.0.1:6379> MULTI
OK
127.0.0.1:6379> INCR test
QUEUED
127.0.0.1:6379> INCR test1
QUEUED
127.0.0.1:6379> DISCARD
OK

Previous: UNSUBSCRIBE
Next: EXEC