UNSUBSCRIBE
UNSUBSCRIBE [channel [channel ...]]
- Available since:
- Redis Open Source 2.0.0
- Time complexity:
- O(N) where N is the number of channels to unsubscribe.
- ACL categories:
-
@pubsub,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
Unsubscribes the client from the specified channels, or from all channels if none are specified.
If you don’t specify any channels, the client unsubscribes from all previously subscribed channels. The client receives one message for each channel it unsubscribes from.
Optional arguments
channel [channel ...]
One or more channels to unsubscribe from. If omitted, the client is unsubscribed from all channels.
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
When successful, this command doesn't return anything. Instead, for each channel, one message with the first element being the string
unsubscribe is pushed as a confirmation that the command succeeded.