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

Usability #5058

Closed
brandonros opened this issue Jun 23, 2018 · 2 comments
Closed

Usability #5058

brandonros opened this issue Jun 23, 2018 · 2 comments

Comments

@brandonros
Copy link

  1. Lists have RPOPLPUSH. Why don't hashes have something like "atomically move from one hash to another"? Why don't sorted lists have an RPOPLPUSH equivalent? Why don't sets have an RPOPLUSH equivalent?

  2. Why can't you get the length of a list?

@itamarhaber
Copy link
Member

Hello @brandonros,

Why don't hashes have something like "atomically move from one hash to another"?

My guess is that isn't a popular request (first time I've heard of it). If you need it, a Lua script that does it is both idempotent and trivial to implement.

Why don't sorted lists have an RPOPLPUSH equivalent?

"sorted lists" aren't one of Redis' type, assuming you meant sorted sets. See #4879 (comment) and specifically the 2nd paragraph about BZPOPZADD.

Why don't sets have an RPOPLUSH equivalent?

Sets aren't ordered... what does RPOPing from a Set mean? Aaanyway, if you need random popping from a Set and shoving it into another one... again uncommon pattern... again Lua to the rescue.

Why can't you get the length of a list?

What's wrong with calling LLEN?

P.S. I found that the tone you're using in the issue is evoking some very negative emotions in me for some reason, you may want to take that into future consideration.

@itamarhaber
Copy link
Member

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