DISCARD to throw away the commands queued since MULTI and leave the transaction without running anything.
It also clears every key watched with WATCH, so the connection ends up in its normal state. This is what you call when the data you read after WATCH turns out to make the queued update unnecessary or invalid.
The raw command is TCP-only. Over HTTP, use the transaction or pipeline API of an Upstash SDK instead of sending this command directly.
Syntax
Arguments
This command takes no arguments.Important points
- The raw command is TCP-only. For HTTP, use an Upstash SDK transaction API rather than sending this command directly.
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs