Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

The "Multi Mix Set" operation of the Redis Enhanced node allows users to set multiple keys in a Redis database simultaneously, with automatic detection and support for different data types such as strings, hashes, lists, and sets. This operation supports complex values including JSON objects and arrays, enabling flexible and structured data storage in Redis.

This operation is beneficial when you need to update or insert multiple related pieces of data in Redis at once, especially when those data items vary in type. For example, you might want to store user profile information (hash), a list of recent activities (list), and some simple flags or counters (strings) all in one atomic-like batch operation.

Practical examples:

  • Setting multiple configuration parameters where some are simple strings and others are JSON objects.
  • Storing a user's session data that includes a hash of attributes and a list of recent actions.
  • Updating several cache entries of different types in one go to improve performance and reduce round-trips to Redis.

Properties

Name Meaning
Value Is JSON Whether the value part of key-value pairs should be interpreted as JSON or as raw key-value pairs (only for hash key type). Default is true.
Key-Value Pairs The key-value pairs to set in Redis. Supports JSON values for complex data types. Format example: key1 "string_val" key2 {"field":"value"} key3 ["item1","item2"]. This property is required for the Multi Mix Set operation.

Output

The output is an array of JSON objects corresponding to each input item processed. Each output JSON object contains the original input data merged with a field named redis_result which holds the result of the set operation for that item.

Specifically for the Multi Mix Set operation:

  • The node does not return detailed results per key but confirms successful execution by passing through the input data with the added redis_result.
  • If an error occurs during processing, it will either throw an error or include an error message in the output JSON if "Continue On Fail" is enabled.

No binary data output is produced by this operation.

Dependencies

  • Requires a Redis server connection configured via credentials providing necessary authentication (e.g., API key or password).
  • The node uses a Redis client library to connect and execute commands.
  • No additional external services are required beyond the Redis instance.

Troubleshooting

  • Invalid JSON in Values: If the JSON parsing of values fails (e.g., malformed JSON in key-value pairs), the node throws an error indicating invalid JSON. Ensure all JSON values are correctly formatted.
  • Uneven Key-Value Arguments: The key-value pairs must be an even number of arguments (each key must have a corresponding value). An odd number will cause an error.
  • Connection Issues: Failure to connect to Redis or authenticate will cause errors. Verify Redis credentials and network connectivity.
  • Unsupported Data Types: While the node attempts automatic type detection, unsupported or unexpected data structures may cause failures.
  • Large Payloads: Sending very large JSON objects or many keys at once may impact performance or cause timeouts.

To resolve errors:

  • Validate JSON syntax before input.
  • Check that key-value pairs are complete and properly spaced.
  • Confirm Redis server availability and credentials.
  • Use smaller batches if encountering timeouts or memory issues.

Links and References

Discussion