Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node_redis - how to remove a key?

Is there any way to remove/delete an entry by key, using Node_redis? I can't see any such option from the docs..

like image 855
UpTheCreek Avatar asked Mar 05 '13 08:03

UpTheCreek


People also ask

How to delete key in redis Node?

“redis delete keys by pattern nodejs” Code Answer'scall('keys', ARGV[1]) \n for i=1,#keys,5000 do \n redis. call('del', unpack(keys, i, math. min(i+4999, #keys))) \n end \n return keys" 0 prefix:*

How do I get all Redis keys?

To list the keys in the Redis data store, use the KEYS command followed by a specific pattern. Redis will search the keys for all the keys matching the specified pattern. In our example, we can use an asterisk (*) to match all the keys in the data store to get all the keys.


1 Answers

You can del use like this:

redis.del('SampleKey'); 
like image 111
himanshu yadav Avatar answered Oct 10 '22 09:10

himanshu yadav