What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

DISCARD

Discards a transaction.

Usage
DISCARD
Complexity
O(N), when N is the number of queued commands
Since
2.0.0
ACL Categories
@fast, @transaction
Command flags
NOSCRIPT, LOADING, STALE, FAST, ALLOW_BUSY

Flushes 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.

Replies

RESP2

RESP3