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

MapReduce result vivification #106

Open
seancribbs opened this issue Feb 18, 2011 · 1 comment
Open

MapReduce result vivification #106

seancribbs opened this issue Feb 18, 2011 · 1 comment

Comments

@seancribbs
Copy link
Contributor

Reference: https://gist.github.com/38eb017bf86d055d2e4e

Either automatic, implicit, or explicit reification of MapReduce results into appropriate Document instances.

Possibilities:

  • Detect presence of _type field in results, instantiate as appropriate.
  • Explicit #to_docs method.
  • ...? (add more ideas in comments)
@tpjg
Copy link

tpjg commented Apr 19, 2011

I was looking for this functionality. I'm a complete newbie to Riak and it took me quite a while to figure out how the whole MapReduce stuff worked. But if you're trying to achieve this for a single (known) type, I think it could be as simple as adding the following as the last stage to MapReduce:

r = Riak::MapReduce.new .....
map("function(v){ return [v.key]; }", :keep => true).run

results = Type.find(r)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants