Actions36
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- Keys
- List Length
- List Range
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
Overview
The node "Redis Enhanced" provides a comprehensive interface to interact with a Redis database, supporting a wide range of Redis operations. Specifically, the "Sorted Set Remove" operation allows users to remove one or more members from a sorted set stored in Redis. This is useful for managing ranked or scored collections where certain elements need to be deleted based on application logic.
Common scenarios include:
- Removing outdated or irrelevant entries from leaderboards.
- Cleaning up sorted sets that track time-sensitive data.
- Managing priority queues by removing specific items.
For example, if you have a sorted set representing user scores in a game, you can remove players who are no longer active by specifying their member names.
Properties
| Name | Meaning |
|---|---|
| Sorted Set | The name of the sorted set in Redis from which members will be removed. |
| Members | Space-separated list of members to remove from the sorted set (e.g., "member1 member2"). |
Output
The output JSON object contains information about the removal operation:
sortedSet: The name of the sorted set affected.removed: The number of members successfully removed.members: An array of the members that were requested to be removed.
Example output:
{
"sortedSet": "mySortedSet",
"removed": 2,
"members": ["member1", "member2"]
}
This confirms which members were targeted and how many were actually removed.
Dependencies
- Requires a connection to a Redis instance.
- Needs an API key credential or equivalent authentication configured in n8n to connect securely to Redis.
- The node uses the Redis client library internally to perform commands.
Troubleshooting
Issue: No members are removed even though specified.
- Cause: Members may not exist in the sorted set.
- Solution: Verify the member names are correct and exist in the sorted set.
Issue: Error related to connection or authentication.
- Cause: Invalid or missing Redis credentials.
- Solution: Check the Redis credentials configuration in n8n and ensure connectivity.
Error: "Score-member pairs must be even number of arguments"
- Note: This error applies to the "Sorted Set Add" operation but indicates input format issues; ensure inputs are correctly formatted.
If the node throws errors during execution, enabling "Continue On Fail" can help process other items without stopping the workflow.
Links and References
- Redis Sorted Sets Documentation
- Redis ZREM Command
- n8n Redis Integration Docs (general reference)