Skip to content
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

zdiff commande ignore keyPrefix #1591

Open
liavsitruk opened this issue May 30, 2022 · 2 comments · May be fixed by #1610
Open

zdiff commande ignore keyPrefix #1591

liavsitruk opened this issue May 30, 2022 · 2 comments · May be fixed by #1610
Labels

Comments

@liavsitruk
Copy link

liavsitruk commented May 30, 2022

Hi,

It looks like zdiff command ignores the keyPrefix variable in the RedisOptions (inherited from CommanderOptions.)
I used redis-cli monitor command to validate this.
In other commands (like zrange for example) the prefix added to the key.

Example:
this.redis = new Redis(redisAddress, {keyPrefix: 'myKeyPrefix:', db: redisDbIndex});

this.redis.zdiff(2, key1, key2);
// in monitor: "zdiff" "2" "key1" "key2"

this.redis.zrange(key1, 0, -1);
// in monitor: "zrange" "myKeyPrefix:key1" "0" "-1"

Thanks

@luin luin added the bug label Jun 12, 2022
@luin luin linked a pull request Jun 25, 2022 that will close this issue
@luin
Copy link
Collaborator

luin commented Jun 25, 2022

Hi @liavsitruk 👋 ,

This is a bug that some newly added commands do not support keyPrefix well. I created a PR for this: #1610.

However, I'm not sure we should release this bugfix as a non-major version as it could break your code if you manually prefix myKeyPrefix: to zdiff. I'd like to learn how did you mitigate the issue in your code? Did you ditch keyPrefix at all or patch newly added commands manually?

@liavsitruk
Copy link
Author

liavsitruk commented Jun 27, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants