# A problem with redis node

**URL:** <https://community.n8n.io/t/a-problem-with-redis-node/8522>\
**Category:** Questions\
**Tags:** node\
**Created:** [October 17, 2021, 6:41am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522 "2021-10-17T06:41:58Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![koraal](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@koraal](https://community.n8n.io/u/koraal)\
**Post date:** [October 17, 2021, 6:41am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/1 "2021-10-17T06:41:58Z")

</div>

hello!

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

i was setting some test hash field

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/4/4a4a4afbd83df8c838fe475c80d653829a8fcc01.png)

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

but actually, this is how it was inserted:

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/9/9dfaf27237e669de38a97e1969de1b14a0dc9389.png)

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:

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/c/c97f533783bb1edb6ec724795cf81711b4ecc8df.png)

the right way to insert hash, is like this:

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/9/9b68bcca76fec72ed20f9dfa09b490fe8505e3bf.png)

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 17, 2021, 6:54am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/2 "2021-10-17T06:54:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![koraal](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@koraal](https://community.n8n.io/u/koraal)\
**Post date:** [October 17, 2021, 6:59am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/3 "2021-10-17T06:59:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 17, 2021, 7:35am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/4 "2021-10-17T07:35:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![koraal](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@koraal](https://community.n8n.io/u/koraal)\
**Post date:** [October 17, 2021, 8:18am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/5 "2021-10-17T08:18:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 17, 2021, 11:16am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/6 "2021-10-17T11:16:46Z")

</div>

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.

> <https://github.com/n8n-io/n8n/pull/2327>
>
> Changed the loop in the Hash set to split on a space instead of splitting on eac…h character. More information is in https://community.n8n.io/t/a-problem-with-redis-node/8522

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [October 17, 2021, 11:56am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/7 "2021-10-17T11:56:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![koraal](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@koraal](https://community.n8n.io/u/koraal)\
**Post date:** [October 18, 2021, 4:05pm UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/8 "2021-10-18T16:05:17Z")

</div>

solution works. you can merge it in

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 18, 2021, 4:17pm UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/9 "2021-10-18T16:17:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![atsmusz](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/atsmusz/32/954_2.png) [@atsmusz](https://community.n8n.io/u/atsmusz)\
**Post date:** [April 28, 2022, 1:27am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/10 "2022-04-28T01:27:20Z")

</div>

This still seems to be broken?

 ![ats-2022-04-27_18-28](https://europe1.discourse-cdn.com/n8n/original/2X/7/7766abb67f52d96cfc3eac32b281446cf8aa4093.png)

Output:

 ![ats-2022-04-27_18-33](https://europe1.discourse-cdn.com/n8n/original/2X/0/0eb23adb3e793b0104f14558650a503de57315b5.png)

If I do the same thing in the CLI

 ![ats-2022-04-27_18-44](https://europe1.discourse-cdn.com/n8n/original/2X/4/48db050e42832259c2df2cbca0fc099783dd365b.png)

It works as expected:

 ![ats-2022-04-27_18-45](https://europe1.discourse-cdn.com/n8n/original/2X/6/6bbadf603d7230e2928d460fbc505da1b2f2d5fe.png)

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

---

<div class="post-metadata">

**Author:** ![miguel-mconf](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/miguel-mconf/32/11293_2.png) [@miguel-mconf](https://community.n8n.io/u/miguel-mconf)\
**Post date:** [February 28, 2023, 1:05pm UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/11 "2023-02-28T13:05:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [February 28, 2023, 3:55pm UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/12 "2023-02-28T15:55:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![miguel-mconf](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/miguel-mconf/32/11293_2.png) [@miguel-mconf](https://community.n8n.io/u/miguel-mconf)\
**Post date:** [February 28, 2023, 4:30pm UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/13 "2023-02-28T16:30:50Z")

</div>

@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:

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

```

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [March 1, 2023, 5:28am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/14 "2023-03-01T05:28:05Z")

</div>

Hey @miguel-mconf,

That sounds familiar.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [April 19, 2023, 8:49am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/15 "2023-04-19T08:49:24Z")

</div>

New version [`n8n@0.223.0`](https://github.com/n8n-io/n8n/releases/tag/n8n%400.223.0) got released which includes the [GitHub PR 5832](https://github.com/n8n-io/n8n/pull/5832).

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [July 18, 2023, 8:50am UTC](https://community.n8n.io/t/a-problem-with-redis-node/8522/16 "2023-07-18T08:50:22Z")

</div>

Closed on July 18, 2023, 8:50am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
