New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete array of keys in redis using node-redis #873
Comments
It's a bit weird, but it will get the job without iterating. |
@abhaygarg This should work out of the box just as you wrote it. Could you provide more of your code? I guess the error is somewhere in your code. And what version do you use? @stockholmux this is not the solution to the issue. Actually it is better to use the array notation right away instead of using arguments (they will be rewritten to an array internal). |
yeah its working you can directly pass array in Redisclient.del(tokenKeys,function(err,count){ |
|
@knoxcard FYI - Don't use KEYS - it's dangerous on large production system. |
I have arrays of keys like ["aaa","bbb","ccc"] so I want to delete all these keys from redis using one command . I donot want to iterate using loop . I read about redis command DEL and on terminal redis-client it works but using nodejs it does not work
Redisclient.del(tokenKeys,function(err,count){
Logger.info("count is ",count)
Logger.error("err is ",err)
})
where tokenKeys=["aaa","bbb","ccc"] , this code is work if I send one key like tokenKeys="aaa"
The text was updated successfully, but these errors were encountered: