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

Inconsistent ZRANGE #1393

Open
vanshavenger opened this issue Dec 22, 2024 · 4 comments
Open

Inconsistent ZRANGE #1393

vanshavenger opened this issue Dec 22, 2024 · 4 comments
Assignees

Comments

@vanshavenger
Copy link
Contributor

          ## Setup Command

ZADD leaderboard 50 "Alice" 70 "Bob" 60 "Charlie" 80 "Dave"

Commands and Observations

  1. ZRANGE leaderboard 0 0

Redis: Returns the lowest score entry ("Alice")
DiceDB: Matches Redis behavior.

  1. ZRANGE leaderboard -1 -1

Redis: Returns the highest score entry ("Dave")
DiceDB: Matches Redis behavior.

  1. ZRANGE leaderboard 0 01

Redis: (error) ERR value is not an integer or out of range
DiceDB: Command succeeds unexpectedly.

  1. ZRANGE leaderboard -1 0

Redis: Returns an empty array.
DiceDB: Produces no output.

  1. ZRANGE leaderboard 1 0

Redis: Returns an empty array.
DiceDB: Produces no output.

  1. ZRANGE leaderboard (60 80 BYSCORE

Redis: Executes correctly, returning entries with scores between 60 and 80, exclusive of 60.
DiceDB: Error: ERR syntax error

  1. ZRANGE leaderboard (60 (80 BYSCORE

Redis: Executes correctly, returning entries with scores strictly between 60 and 80.
DiceDB: Error: ERR syntax error

  1. ZRANGE leaderboard [a [z BYLEX

Redis: Executes correctly, returning entries between lexical ranges.
DiceDB: Error: ERR syntax error

  1. ZRANGE leaderboard 0 3 WITHSCORES REV

Redis: Returns entries in descending score order with scores.
DiceDB: Matches Redis behavior.

  1. ZRANGE random 0 2 (key that is not in the cache)

Redis: Returns (empty array)
DiceDB: Produces no output.

  1. ZRANGE leaderboard (1 +inf BYSCORE LIMIT 0 2

Redis: Returns up to 2 entries with scores greater than 1.
DiceDB: Error: ERR syntax error

I believe Error: ERR syntax error means not implemented. I'm open to implementing the missing parts (new to Golang will take me a lot of time tho).

Originally posted by @jonathanalvares9009 in #1284 (comment)

@vanshavenger
Copy link
Contributor Author

@apoorvyadav1111 @lucifercr07
Kindly asign me this.

I have a PR ready for the BYScores, BYLEx, and soe other missing things in ZRNAGE and all the above things are working correctly.

@vanshavenger
Copy link
Contributor Author

Also please let me know if i should go ahead and add or update ZRANGE docs too.

@lucifercr07
Copy link
Contributor

@vanshavenger assigned, thanks for contributing. Please update the docs if required.

@vanshavenger
Copy link
Contributor Author

#1396

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

2 participants