RESET to return the connection to the state it had right after connecting.
It discards an open MULTI block, unwatches every key watched with WATCH, leaves subscriber and monitor modes, clears the connection name, re-enables replies, and de-authenticates the connection when the database requires a password. This makes it the safe way to hand a connection back to a pool after an error, since the next user cannot inherit a half-finished transaction or a leftover subscription.
Syntax
Arguments
This command takes no arguments.Important points
- This is a connection-oriented command and is available over native Redis TCP, not the stateless REST endpoint.
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