discard.3valkey - Man Page

Discards a transaction.

Synopsis

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

valkey-protocol(7) Simple string reply: OK.

Complexity

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

Acl Categories

@fast @transaction

History

See Also

exec(3valkey), multi(3valkey), unwatch(3valkey), watch(3valkey)

Info

2025-01-08 8.0.2 Valkey Command Manual