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

LPOP count support? #976

Closed
adamgamble opened this issue Feb 20, 2021 · 2 comments · Fixed by #982
Closed

LPOP count support? #976

adamgamble opened this issue Feb 20, 2021 · 2 comments · Fixed by #982

Comments

@adamgamble
Copy link

In the redis documentation, lpop supports a count argument. I can't seem to figure out how to do that with redis-rb.
Am I missing something or does redis-rb not support the count argument?

https://redis.io/commands/lpop

@supercaracal
Copy link
Contributor

supercaracal commented Feb 21, 2021

Hello,

I think it is the latter.

>= 6.2: Added the count argument.

It seems that the Gem just hasn't support it yet.

ref: #978

@bpo
Copy link
Contributor

bpo commented Mar 3, 2021

Hi - you can do this today with the call command, which supports arbitrary commands so you don't need to wait on any client modifications when using a new command (or using modules, etc):

redis.call :lpop, 'mylist'
=> "one"
redis.call :lpop, 'mylist', 2
=> ["two", "three"]

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.

3 participants