Actions37
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- Keys
- List Length
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Members
- 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. It allows users to get, set, update, and manage data stored in Redis with enhanced capabilities beyond basic commands. This includes working with strings, hashes, lists, sets, sorted sets, key expiration, Lua scripting, and more.
For the Set Add operation specifically, the node adds one or more members to a Redis set. This is useful when you want to maintain a collection of unique items (e.g., tags, user IDs, categories) without duplicates.
Practical examples:
- Adding new tags to a set representing blog post categories.
- Storing unique user IDs who performed an action.
- Managing membership lists for groups or channels.
Properties
| Name | Meaning |
|---|---|
| Set | The name of the Redis set to which members will be added. |
| Members | Space-separated list of members to add to the set (e.g., "member1 member2 member3"). |
| Value Is JSON | (Shown only if key type is hash) Indicates whether the value is JSON or key-value pairs. |
Output
The output JSON object for the Set Add operation contains:
set: The name of the set where members were added.added: The number of members that were actually added to the set (excluding existing members).members: An array of the members that were attempted to be added.
Example output:
{
"set": "mySet",
"added": 2,
"members": ["member1", "member2"]
}
This output confirms which members were added and how many were new additions.
Dependencies
- Requires a Redis server connection configured via credentials providing necessary authentication.
- The node uses a Redis client library internally to communicate with the Redis instance.
- No additional external services are required beyond the Redis server.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Providing an empty or invalid set name or members string.
- Attempting to add members to a key that is not a set type in Redis.
Error messages:
- Errors related to connection or authentication will indicate inability to connect or authenticate with Redis.
- If the members string is malformed or empty, the node may throw an error about invalid input.
- Redis errors such as wrong key type will occur if the target key exists but is not a set.
Resolutions:
- Verify Redis credentials and network accessibility.
- Ensure the set name and members are correctly specified.
- Confirm the key is either non-existent or already a set type before adding members.
Links and References
- Redis Sets Documentation
- Redis Command SADD
- n8n Documentation (for general node usage and credential setup)