Help with redis

Hello,
I am using https://flows.nodered.org/node/node-red-contrib-redis. I have some issues to find the right syntax when using the cmd node. As the documentation is pretty scarce I wonder if someone can help here.
I want, for example, to get alerted when a key expires.
The first thing to do is to run the following:

CONFIG SET notify-keyspace-events KEx

This syntax is for the CLI.

I therefore try to use the cmd node from the palette.
Put CONFIG as the Command and the I have tried many thing for the params:

{
    "SET": [
        "notify-keyspace-events",
        "KEx"
    ]
}

or

[
        "SET",
        "notify-keyspace-events",
        "KEx"
]

...
None is working.
I always have an error such as:

ReplyError: ERR wrong number of arguments for 'config' command

Any clue? Thanks.

I reply to myself :slight_smile:
In fact the second syntax is the correct one. However, msg.payload and msg.topic must be deleted for this to work.
Here is a working example:

[{"id":"ba6abd6293937835","type":"debug","z":"10f9da15bd6258a7","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":760,"wires":[]},{"id":"195cb02ecf52373a","type":"redis-command","z":"10f9da15bd6258a7","server":"8f497140bcbdd802","command":"CONFIG","name":"","topic":"","params":"[\"SET\",\"notify-keyspace-events\",\"KEx\"]","paramsType":"json","payloadType":"json","block":false,"x":640,"y":760,"wires":[["ba6abd6293937835"]]},{"id":"899aeb5a9de512e5","type":"inject","z":"10f9da15bd6258a7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"num","x":270,"y":760,"wires":[["9ea443d6572d5a1f"]]},{"id":"9ea443d6572d5a1f","type":"change","z":"10f9da15bd6258a7","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":760,"wires":[["195cb02ecf52373a"]]},{"id":"8f497140bcbdd802","type":"redis-config","name":"Redis","options":"redis:6379","cluster":false,"optionsType":"str"}]
1 Like

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