Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

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 delete data in Redis with enhanced capabilities beyond basic commands. This node is beneficial for scenarios where you need to integrate Redis caching, messaging, or data storage into your workflows, such as:

  • Managing sets, lists, hashes, and sorted sets in Redis.
  • Performing atomic increments or conditional key setting.
  • Executing Lua scripts for complex Redis operations.
  • Publishing messages to Redis channels for real-time communication.
  • Scanning keys and managing key expiration.

For example, you can use this node to add members to a Redis set, check if a value is a member of a set, get the number of members in a set (cardinality), or remove members from a set.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (only shown when key type is hash).
Set Name of the Redis set to operate on (required for set-related operations like sadd, srem, etc.).

These properties are specific to the "Set Cardinality" operation and related set operations (sadd, srem, sismember, scard, smembers).

Output

The output JSON structure depends on the specific set operation performed:

  • For Set Cardinality (scard):

    {
      "set": "<set name>",
      "cardinality": <number_of_members>
    }
    

    Returns the number of members in the specified set.

  • For Set Add (sadd):

    {
      "set": "<set name>",
      "added": <number_of_members_added>,
      "members": ["member1", "member2", ...]
    }
    

    Indicates how many members were added and lists them.

  • For Set Remove (srem):

    {
      "set": "<set name>",
      "removed": <number_of_members_removed>,
      "members": ["member1", "member2", ...]
    }
    

    Indicates how many members were removed and lists them.

  • For Set Is Member (sismember):

    {
      "set": "<set name>",
      "member": "<member>",
      "isMember": true|false
    }
    

    Indicates whether the specified member belongs to the set.

  • For Set Members (smembers):

    {
      "set": "<set name>",
      "members": ["member1", "member2", ...]
    }
    

    Lists all members of the set.

The node does not output binary data for these operations.

Dependencies

  • Requires a Redis server connection configured via an API key credential or equivalent authentication method.
  • The node uses a Redis client library internally to communicate with the Redis instance.
  • No additional external services are required beyond the Redis server itself.

Troubleshooting

  • Common Issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Errors when providing malformed input, e.g., invalid set member strings or empty set names.
    • Using operations incompatible with the data type stored at a given key.
  • Error Messages:

    • If the Redis server is unreachable or credentials are invalid, the node will throw a connection error.
    • When key-value pairs or member lists are incorrectly formatted (e.g., uneven number of arguments), the node throws descriptive errors.
    • If an operation fails on a non-existent or wrong-type key, Redis errors will be surfaced; ensure the key exists and matches expected data type.
  • Resolution Tips:

    • Verify Redis credentials and network connectivity.
    • Ensure input parameters like set names and members are correctly specified.
    • Use the correct operation matching the Redis data type stored at the key.

Links and References

Discussion