-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
bug? keyPrefix not added to the KEYS command #239
Comments
Actually it's not a bug. ioredis relies on the |
Ah ok, i got the point. |
How are you able to determine what keys you actually have in redis, if the keys parameter would be prefixed? This is not possible in that case, so if you want to have the keys command prefixed you might consider adding a arguments transformer to it to always prefix the argument. I do not recommend it though. |
Ok, // Just pretend that it works without promises/callbacks :)
// prefx: "NS:"
let keys = redisP.keys( '*' ); // keys = [ "key1", "NS:key2" ]
// This will NEVER get "key1" because the get is namespaced
let val = redisP.get( keys[0] );
// also i cannot get "NS:key2" because i will get "NS:NS:key2" instead |
@Volox I agree with you that it is of course a little inconvenience for people who want to use the However, It's not hard to make the pattern also be prefixed, but I don't want to let ioredis do too much magic. There are other commands that should be prefixed if we handle the I don't want to mislead people into thinking they can reply on the The workaround is to create another instance for |
Thanks to all for the support, I see there is no easy solution for this. |
Hi,
i have a problem with the KEYS command and the use of
keyPrefix
. It seems that using a prefixed connection the prefix is not passed to the KEYS command.I created a simple snippet of code to reproduce the problem.
The text was updated successfully, but these errors were encountered: