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

MHGETALL command to get multiple fields and values from multiple hashes #109

Closed
Bessonov opened this issue Sep 29, 2011 · 3 comments
Closed

Comments

@Bessonov
Copy link

Hello,

I think it can save network traffic between client and server and make queries convenient and faster. My use case:

HMSET user:1 name User1
HMSET user:2 name User2
HMSET user:3 name User3

And now get all three users with custom delmiter between hashes (inevitably?):

MHGETALL #delimiter# user:1 user:2 user:3

  1. name
  2. User1
  3. #delimiter#
  4. name
  5. User2
  6. #delimiter#
  7. name
  8. User3

Best regards

Anton

@pietern
Copy link
Contributor

pietern commented Sep 30, 2011

This will not be implemented because it requires all keys to be available on a single server, and is therefore not well suited in a distributed environment. We avoid to add commands that have this characteristic. You can achieve the same result using a MULTI/EXEC block with HGETALL commands. While this does result in some extra bytes on the wire, you'll find that it is almost as fast as a native command when the group of commands is sent to Redis in a pipelined fashion.

Cheers,
Pieter

@antirez
Copy link
Contributor

antirez commented Sep 30, 2011

Also note that a Redis Lua script can implement this without issues. Scripting is available in Redis unstable and will be available into 2.6 stable in the future.

@antirez antirez closed this as completed Sep 30, 2011
@Bessonov
Copy link
Author

Bessonov commented Oct 1, 2011

Thanks for the info!

KFilipek added a commit to KFilipek/redis that referenced this issue Apr 3, 2019
…itch

Fix default Redis compilation w/o Memkind
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