GET.UNWATCH
The GET.UNWATCH
command is a feature to stop receiving updates on a key.
Protocol Support
Protocol | Supported |
---|---|
TCP-RESP | ✅ |
HTTP | ❌ |
WebSocket | ❌ |
Syntax
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
fingerprint | Fingerprint returned as part of the get.watch query | String | Yes |
Return Value
Condition | Return Value |
---|---|
Command is successful | OK |
Behavior
- The client unsubscribes from the specified key.
Errors
Missing fingerprint
- Error Message:
(error) ERROR wrong number of arguments for 'get.watch' command
- Occurs if no fingerprint is provided.
- Error Message:
Example Usage
Basic Usage
Let’s explore a practical example of using the GET.WATCH
command to create a real-time journal which takes backup periodically.
This query does the following:
- Monitors key matching the name
journal:user:0
When the key is updated using following set of commands from another client:
The client will receive a message similar to the following:
To stop receiving updates on the key, use the GET.UNWATCH
command.
Notes
Use the GET.WATCH
command to subscribe to a key. This will allow the client to receive updates on the key. Please refer to
the GET.WATCH command documentation for more information.
Related commands
following are the related commands to GET.UNWATCH
: