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

SET with NX flag does not work as expected #198

Open
przpl opened this issue Sep 22, 2021 · 0 comments · May be fixed by #202
Open

SET with NX flag does not work as expected #198

przpl opened this issue Sep 22, 2021 · 0 comments · May be fixed by #202

Comments

@przpl
Copy link

przpl commented Sep 22, 2021

Example code

 this._client.SET("key", "value", "NX", (err, reply) => {
    console.log(reply); // should print "OK" only on the first call
});

NX is "Only set the key if it does not already exist" flag.

On real Redis we will get "OK" on the first call and null on the second, which is expected as the value was set at the first time and cannot be overwritten. Redis-mock will respond with "OK" on the first call, second and any other afterward which is not correct behavior.

@sampsasaarela sampsasaarela linked a pull request Dec 17, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant