MULTI to start a transaction.
Commands sent afterwards are not executed but queued, each answered with QUEUED, until EXEC runs them all in order with nothing else in between, or DISCARD throws them away.
A Redis transaction is atomic in the sense that no other client sees a partial result, but it is not a rollback mechanism: a command that fails at queue time, such as one with a syntax error, aborts the whole transaction, while a command that fails at execution time, such as one applied to the wrong type, leaves the commands around it applied. Combine it with WATCH when the transaction depends on values you read beforehand.
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