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

LRANGE List -1 2 is not working #427

Open
codejamtc opened this issue Jan 14, 2019 · 4 comments
Open

LRANGE List -1 2 is not working #427

codejamtc opened this issue Jan 14, 2019 · 4 comments
Assignees

Comments

@codejamtc
Copy link

image

  1. Deploy the App and run the application (Magenta Theme)
  2. Create a List with data https://github.com/topcoderinc/TC-redis-manager/files/2755278/db-1547472272101.zip
  3. Expand the CLI
  4. Enter LRANGE List -1 2

https://redis.io/commands/lrange

Actual: LRANGE List -1 2 is not working

Expected: Should return correct data

Browser(s): Chrome 71.0.3578.98 (Windows)

@sumitdaga sumitdaga self-assigned this Jan 16, 2019
@sumitdaga
Copy link
Contributor

the command does work it should be LRANGE List 1 2 and not LRANGE List -1 2 just that it displayed in one single row which i will fix
refer http://take.ms/FoGLq

@standlove
Copy link
Collaborator

negative index works for LRANGE as well according to: https://redis.io/commands/lrange

@sumitdaga
Copy link
Contributor

oh yes right ...i will look into it!

@sumitdaga
Copy link
Contributor

sumitdaga commented Jan 16, 2019

ok so yes the condition is that start should be greater than stop otherwise it returns null ...so if you see the documentation -1 is the last element and 2 is the 3rd element and so stop is lesser than start ...so it won't return anything
for ex LRANGE List -2 60 will work and return 2 elements the penumltimate and the last element

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

3 participants