# Help with redis

**URL:** <https://discourse.nodered.org/t/help-with-redis/69806>\
**Category:** General\
**Created:** [30 October 2022 20:02 UTC](https://discourse.nodered.org/t/help-with-redis/69806 "2022-10-30T20:02:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [30 October 2022 20:02 UTC](https://discourse.nodered.org/t/help-with-redis/69806/1 "2022-10-30T20:02:11Z")

</div>

Hello,  
I am using [https://flows.nodered.org/node/node-red-contrib-redis](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:

```auto
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:

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

```

or

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

```

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

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

```

Any clue? Thanks.

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [31 October 2022 07:19 UTC](https://discourse.nodered.org/t/help-with-redis/69806/2 "2022-10-31T07:19:55Z")

</div>

I reply to myself 🙂  
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:

```auto
[{"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"}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 November 2022 07:20 UTC](https://discourse.nodered.org/t/help-with-redis/69806/3 "2022-11-14T07:20:14Z")

</div>

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