My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 574: [Feature Request] MAP command
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by james.keane, Jun 4, 2011
I propose a new command that operates on sets, lists, and hashes, or any other type of collection.

The command maps items from a collection to other redis commands.

i.e. MAP 'user:1:friends' HGETALL 'user:*'
  where * is replaced by the items in the set 'user:1:friends'.

Jun 4, 2011
#1 josiah.c...@gmail.com
For sets and lists...
SORT <set|list> BY nosort GET user:*->field

Will get a single field. You can have multiple GET options to get multiple fields. Considering that the scripting branch will make this particular kind of thing easy (what you really want is the HGETALL, I am sure), it's probably not going to make it.
Jun 6, 2011
#2 michail_...@mail.ru
But be aware that SORT doesn't keep order of keys as they stored in Sorted Set when it is used to select objects by keys with option 'BY nosort'.

See for details: http://groups.google.com/group/nosql-databases/browse_thread/thread/f41e601c4e3e49fc/b7a56e9427a8cc49#b7a56e9427a8cc49

So you actaully need to use SORT instead of MAP but use it with care.
Jun 6, 2011
#3 josiah.c...@gmail.com
That's because it pulls the keys from the hash portion of the sorted set, not from the skiplist portion of the sorted set. If you want to get the ids, you would include a "GET #" portion for the SORT call.
Sign in to add a comment

Powered by Google Project Hosting