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

Return value of EXISTS is inconsistent with core redis #54

Open
aeisenberg opened this issue Sep 27, 2017 · 2 comments
Open

Return value of EXISTS is inconsistent with core redis #54

aeisenberg opened this issue Sep 27, 2017 · 2 comments

Comments

@aeisenberg
Copy link

This library, will return true or false for all calls to EXISTS. However, this is not consistent with the return value for core redis. According to the documentation:

Return value

Integer reply, specifically:

  • 1 if the key exists.
  • 0 if the key does not exist.

Since Redis 3.0.3 the command accepts a variable number of keys and the return value is generalized:

  • The number of keys existing among the ones specified as arguments. Keys mentioned multiple times and existing are counted multiple times.

When passing multiple keys, there is no way to determine how many of the keys exist.

@aeisenberg
Copy link
Author

And, looks like the same problem for HEXISTS.

@aeisenberg
Copy link
Author

Even though, SISMEMBER returns a boolean in this library, but an integer in core redis, I don't think the issue is particularly important since SISMEMBER only takes a single value as an argument, the return values are only 1 or 0. So, no data is lost.

aeisenberg pushed a commit to GanchrowScientific/gs-lua-unit that referenced this issue Feb 16, 2018
Returns 1 if key exists or 0 otherwise.

Not exactly correct since calling exists with multiple should return
a number greater than 1 if multiple keys exists, but there is no
way of determining this with the current library. See:

nrk/redis-lua#54

Change-Id: I5b0f63aba26111e0a26e50971520c482d0d9da0b
Reviewed-on: http://gerrit.ganchrow.com:8080/4781
Reviewed-by: Andrew Eisenberg <andrew.eisenberg@ganchrow.com>
Tested-by: Andrew Eisenberg <andrew.eisenberg@ganchrow.com>
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

No branches or pull requests

1 participant