Back to Redis

DISCARD

content/commands/discard.md

latest1022 B
Original Source

Flushes all previously queued commands in a transaction and restores the connection state to normal.

If [WATCH]({{< relref "/commands/watch" >}}) was used, DISCARD unwatches all keys watched by the connection.

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="discard-return-info" tab1="RESP2" tab2="RESP3" >}}

Simple string reply: OK.

-tab-sep-

Simple string reply: OK.

{{< /multitabs >}}