Node-red-contrib-redis 1.4.0

hello everyone,

i'm working with this nodes and i'm facing problems with the redis-command node using hset command.

hget or hgetall works fine.
hset return error "invalid number of arguments" even if the arguments are ok.

I gave a look inside the redis.js and found out that, maybe, in the function RedisCmd when Client.Call is sent out, the number ogìf arguments are not alligned with what the server is expeted to receive.

I wrote a function in Nodered function Node like this
Redis.client.call('hset',MyHSET, FieldName, buf, response) and it works with parameters a I pass.

inside redis.js the function looks like this

client.call(node.command, topic, payload, response);

so it's seems to be an arguments is missing.

does anyone of you already tested this node with this command?

thank you

Hi Frank, welcome to the forum.

As this is a contributed node, you will need to raise a GitHub issue against the node in the hopes that the author will respond.

There are, I note, also several other redis nodes so perhaps one of those would suit you better?

I am a fairly heavy user of this contrib-redis. Can you share a minimal flow showing your problem ?
Typically if in your msg.topic you have a JSON object like [ "myhash", "mykey", "value" ] and delete the msg.payload before calling HSET, it works.
The trick is no msg.payload...

Thank for your replay.

But the problem is, that I wanted to use the node as they are, without using code behind. As for other nodes, when you configure them, at low level the system does what needed without involving you to manage the code itself.
In this case, I see that the node doesn't ork as it is, but needs tricks with code in order to work, isn't so?

I switched in the meantime to ise only the code.
If you confirm that without modifing code at low level it doesn't work as it is, i continue to manage redis with only code.
Thanks

I don't know what you mean by code (function ?).
I am using the nodes as they are.
Just feeding them with the format they expect. When you've understood that, it just works.

Ah ok, but the right format you find it somewhere , or just trying?
Because i'va spent time to findout the right sintax without success. I will try again.

Do you have some documents related ( not the one of redis website, i've already seen it)?

And yes, with code i mean function code and call the function directly there.

Thank you

A while back, I wrote that the document on this contrib-node was challenging aka inexistant.
I found some example and managed my way with that.

Here is an example of hset/hget/hgetall :

[{"id":"abbacc5e71e5252c","type":"inject","z":"3af82246.3634ae","name":"","props":[{"p":"topic","v":"[ \"myhash\", \"mykey\", true ]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1730,"y":80,"wires":[["74209ee548eb8dd5"]]},{"id":"74209ee548eb8dd5","type":"redis-command","z":"3af82246.3634ae","server":"fe8691ad5774eda3","command":"HSET","name":"","topic":"","params":"[]","paramsType":"json","payloadType":"json","block":false,"x":1890,"y":80,"wires":[["4851bf2cf704eec6"]]},{"id":"4851bf2cf704eec6","type":"debug","z":"3af82246.3634ae","name":"debug 22","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2080,"y":80,"wires":[]},{"id":"3c819e6a54297301","type":"inject","z":"3af82246.3634ae","name":"","props":[{"p":"topic","v":"[ \"myhash\", \"mykey\" ]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1730,"y":140,"wires":[["e10ad78bdf567654"]]},{"id":"e10ad78bdf567654","type":"redis-command","z":"3af82246.3634ae","server":"fe8691ad5774eda3","command":"HGET","name":"","topic":"","params":"[]","paramsType":"json","payloadType":"json","block":false,"x":1890,"y":140,"wires":[["ed94050fd79c9e9a"]]},{"id":"ed94050fd79c9e9a","type":"debug","z":"3af82246.3634ae","name":"debug 23","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2080,"y":140,"wires":[]},{"id":"ee8c95ae8fe5e704","type":"inject","z":"3af82246.3634ae","name":"","props":[{"p":"topic","v":"[ \"myhash\" ]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1730,"y":200,"wires":[["a59acda2ab35267f"]]},{"id":"a59acda2ab35267f","type":"redis-command","z":"3af82246.3634ae","server":"fe8691ad5774eda3","command":"HGETALL","name":"","topic":"","params":"[]","paramsType":"json","payloadType":"json","block":false,"x":1900,"y":200,"wires":[["a8cd9db0270c1350"]]},{"id":"a8cd9db0270c1350","type":"debug","z":"3af82246.3634ae","name":"debug 24","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2080,"y":200,"wires":[]},{"id":"fe8691ad5774eda3","type":"redis-config","name":"Redis","options":"redis:6379","cluster":false,"optionsType":"str"},{"id":"6c370e19956e05d4","type":"global-config","env":[],"modules":{"node-red-contrib-redis":"1.4.0"}}]

Ok, thank you.

I appreciate very much.

I will try and in case of problem, i'm going to ask your help, if you can/want to.

Thanks for the moment.

Ragards