DISCARD · Valkey

DISCARD

Discards a transaction.

Usage

DISCARD

Description

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.

Reply

Simple string reply: OK.

Complexity

O(N), when N is the number of queued commands

ACL Categories

@fast @transaction

History

See also

EXEC, MULTI, UNWATCH, WATCH.