PFCOUNT.UNWATCH
The PFCOUNT.UNWATCH
command is a feature to stop receiving updates on a HyperLogLog.
Protocol Support
Protocol | Supported |
---|---|
TCP-RESP | ✅ |
HTTP | ❌ |
WebSocket | ❌ |
Syntax
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
fingerprint | Fingerprint returned as part of the PFCOUNT.WATCH query | String | Yes |
Return Value
Condition | Return Value |
---|---|
Command is successful | OK |
Behavior
- The client unsubscribes from the HyperLogLog key specified by the fingerprint.
Errors
Missing fingerprint
- Error Message:
(error) ERROR wrong number of arguments for 'pfcount.unwatch' command
- Occurs if no fingerprint is provided.
- Error Message:
Example Usage
Basic Usage
Here’s an example of using the PFCOUNT.WATCH
and PFCOUNT.UNWATCH
commands to monitor and stop monitoring the cardinality of a HyperLogLog.
When the HyperLogLog is updated using the following commands from another client:
The subscribing client will receive messages similar to the following:
To stop receiving updates on the key, use the PFCOUNT.UNWATCH
command:
Notes
Use the PFCOUNT.WATCH
command to subscribe to a HyperLogLog key and receive real-time updates. Refer to the PFCOUNT.WATCH command documentation for more details.
Related Commands
The following commands are related to PFCOUNT.UNWATCH
: