Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node_redis CONFIG SET command

I am currently writing an app using redis and I'm having issues with the node_redis library. In particular I am unable to figure out how to use the redis command from within node_redis

I have tried all the following...

client.send_command("CONFIG SET", ["notify-keyspace-events", "Ex"]);
client.config("SET", ["notify-keyspace-events", "Ex"]);

This and other similar variants don't seem to be working... Also I cannot find the command detailed out on the node_redis documentation.

Any help would be greatly appreciated!

ON A SIDE NOTE: I am using this command to create a client (node-side) that will subscribe to key-expire events (I want to perform a couple clean-up operations every time a key expires). Is it acceptable to use the node_redis CONFIG SET equivalent or is it better/common practice to start redis-server with a custom conf file? I would assume the latter however I want to deploy this on Heroku, does that change the circumstances?

Thanks!

like image 704
Eric Walsh Avatar asked Jul 23 '26 01:07

Eric Walsh


1 Answers

You’re very close! The usage is:

client.config("SET", "notify-keyspace-events", "Ex");
like image 197
danorton Avatar answered Jul 24 '26 17:07

danorton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!