Overview
This node performs an atomic increment operation on a specified Redis key. It increments the value of the key by 1, creating the key if it does not exist. Optionally, it can set an expiration timeout on the key after incrementing. This operation is useful for scenarios such as counting events, tracking usage, or managing counters in real-time applications.
Use Case Examples
- Increment a page view counter each time a user visits a webpage.
- Track the number of times a specific action is performed in an application.
- Manage rate limiting by incrementing a key and setting an expiration to reset the count periodically.
Properties
| Name | Meaning |
|---|---|
| Connection Mode | How to manage Redis connections, either by reusing pooled connections for better performance or creating a new connection each time for safety. |
| Key | The name of the Redis key to increment. |
| Expire | Whether to set a timeout on the key after incrementing. |
| TTL | The number of seconds before the key expires if expiration is enabled. |
Output
JSON
- The incremented value of the specified Redis key, where is the name of the key incremented.
Dependencies
- Requires a Redis server and an API key credential for Redis connection.
Troubleshooting
- Connection issues may occur if Redis server credentials are incorrect or the server is unreachable. Verify credentials and network connectivity.
- If the key does not exist, the node will create it and set its value to 1 upon incrementing.
- Setting expiration requires the TTL value to be a positive integer; otherwise, expiration will not be set.
- Errors during Redis operations will throw exceptions unless 'Continue On Fail' is enabled, in which case errors are returned in the output JSON.
Links
- Redis INCR Command - Official Redis documentation for the INCR command used to atomically increment a key's value.