A problem with redis node

hello!

i think there is a bug on the redis node. when using Hash

i was setting some test hash field

according to the redis documents, this should insert 4 values inside. “aa” “bb” “cc” and “dd”

but actually, this is how it was inserted:

the problem is not when getting the data, the problem is when settings the data.
i checked the redis server directly, and it was even stranger, the keys and the values got mixed inside, not just the values:

the right way to insert hash, is like this:

i think the redis node does not insert the hmset in the right way. its separating each letter, instead of using “space” as the separator

Morning,

I think this is down to where there is no field name option so the value is being looped and each character is being inserted as the field name and value.

A quick fix might be to remove that loop but that won’t support multiple values and the field name would still need to be set somewhere.

the separator for each value should be a space, like the last screenshot i put

Can you not have a value with a space in it or would you need to wrap them in quotation marks?

no need value as a space. there is no use case for that

Hey @koraal,

If you get a chance could you check the pull request below, I suspect it will do what you are after but it will need some proper testing.

Let me know when you confirm that what @Jon added fixes the issue to review the PR.

solution works. you can merge it in

This will be a breaking change for anyone using the Redis node with the hash option as the field name now has to be set in the value. The node now works the same way as the redis command line tool does.

This still seems to be broken?

Output:

If I do the same thing in the CLI

It works as expected:

Additional note… GET on a “hash” should use hget and allow getting value for single sub-key.

GET
keyname subkeyname

would return single value of sub-key

Is there any way to use a hash on redis node as of today? I’m getting the same behavior of separated characters as described on this thread.

Hey @miguel-mconf,

There is a way to use it, I will need to check with @RicardoE105 what we found as I can’t remember.

@Jon , thanks for your response.
I think I’ve found out: You’re supposed to use JS objects or arrays with an Expression on the Value parameter, as such:

{{ {"abc": 123, "def": 456, "ghi": 789} }}

Using Fixed values, does not work as far as I’ve tested.

Hey @miguel-mconf,

That sounds familiar.

New version n8n@0.223.0 got released which includes the GitHub PR 5832.