Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

This node, "Redis Enhanced," provides a comprehensive interface to interact with a Redis database, supporting a wide range of Redis operations. It is designed for users who want to get, send, and update data in Redis with enhanced capabilities beyond basic commands.

The "Sorted Set Cardinality" operation specifically retrieves the number of members in a sorted set stored in Redis. This is useful when you need to know the size of a sorted set, for example, to monitor leaderboard sizes, count unique scored items, or manage ranked data collections.

Practical examples:

  • Counting how many users are currently ranked in a game leaderboard.
  • Determining the number of scored events stored in a sorted set for analytics.
  • Checking if a sorted set has reached a certain size before performing further actions.

Properties

Name Meaning
Sorted Set The name of the sorted set in Redis whose cardinality (number of members) you want to get.

Note: The provided properties JSON includes "Value Is JSON" which applies only when the key type is "hash" and is not relevant for the "Sorted Set Cardinality" operation.

Output

The output JSON object contains:

  • sortedSet: The name of the sorted set queried.
  • cardinality: The number of members in the sorted set (an integer).

Example output JSON:

{
  "sortedSet": "mySortedSet",
  "cardinality": 42
}

This output allows downstream nodes or workflows to use the count of members in the sorted set for conditional logic, reporting, or further processing.

Dependencies

  • Requires a Redis server connection configured via an API key credential (generic Redis credentials).
  • The node uses a Redis client library internally to connect and execute commands.
  • No additional external services are required beyond the Redis instance.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Querying a non-existent sorted set will return a cardinality of zero without error.
    • Providing an empty or invalid sorted set name will cause errors.
  • Error messages:

    • Errors related to connection or authentication will be thrown if the Redis server is unreachable or credentials are invalid.
    • If the input for score-member pairs or members is malformed (not applicable here but relevant for other operations), the node throws an error indicating the expected format.
  • Resolution tips:

    • Verify Redis credentials and network connectivity.
    • Ensure the sorted set name is correct and exists in Redis.
    • Use the "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion