Overview
This node interacts with a Redis database, specifically supporting various operations on keys and data structures within Redis. The "Hash Delete" operation allows users to delete one or more fields from a hash stored at a specified key in Redis. This is useful when you want to remove specific entries from a hash without deleting the entire hash.
Practical scenarios include:
- Cleaning up outdated or irrelevant fields from a user profile stored as a hash.
- Removing specific configuration parameters from a hash representing application settings.
- Managing partial updates or deletions in complex Redis data structures.
Properties
| Name | Meaning |
|---|---|
| Hash Key | The name of the Redis hash key from which fields will be deleted. |
| Fields | One or more field names to delete from the hash. Multiple fields can be separated by commas. |
| Value Is JSON | Whether the value is JSON or key-value pairs (relevant for hash-type keys in other operations). |
Output
The output JSON contains a single property:
deletedFields: A number indicating how many fields were successfully deleted from the hash.
Example output:
{
"deletedFields": 2
}
This means two fields were removed from the specified hash key.
Dependencies
- Requires a connection to a Redis instance.
- Needs an API key credential or equivalent authentication configured in n8n to connect to Redis.
- Uses the Redis client library internally to perform commands.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Specifying a non-existent hash key or fields that do not exist; the command will succeed but report zero deleted fields.
- Improperly formatted field names (e.g., extra spaces or empty strings) may cause unexpected behavior.
Error messages:
- Errors related to connection or authentication will typically indicate failure to connect or authenticate with Redis.
- If the node throws an error during execution, enabling "Continue On Fail" can allow processing of subsequent items.
Resolutions:
- Verify Redis credentials and network connectivity.
- Ensure the hash key exists and fields are correctly specified.
- Use comma-separated field names without trailing commas or extra spaces.