Link walking

Andrew Berman rexxe98 at gmail.com
Fri May 6 15:01:48 EDT 2011


I don't totally understand what you're doing in your code, but it looks like
you have the map phase before the link phase which doesn't make sense since
you want the data from the link phase passed on to the map phase, not the
other way around.

On Fri, May 6, 2011 at 9:37 AM, Joshua Hanson <joshua.b.hanson at gmail.com>wrote:

> In my map/reduce query I would like to keep the input data
> and also data from the link-walking phase.
>
> Here is some sample code:
>
> #insert message
> db.save('messages', 'josh-123', 'secret message', function(err, message) {
> #insert people object with link to message we just inserted
>  db.save('people', 'josh', {'profession': 'developer'},
>  { links: [{ bucket: 'messages', key: 'josh-123', 'tag': 'message' }]},
>  function(err, data) {
>  db.add([['people', 'josh']])
> .map({ 'source': 'Riak.mapValuesJson', 'keep': true})
>  .link({ 'bucket': 'messages'})
> .run(function(err, data) {
>  if (err) return console.log(err);
>  console.log(data);
> })
>  }
> )
> })
>
> So, if I remove the 'link' phase I get the correct object from the map
> phase
> but if I instead remove the 'map' phase, I get the correct object from link
> phase.
>
> However, having both together does not work. Is it possible to get at both
> the original data and the data from link-walking in the same query?
> _________________________________
> Joshua Hanson
> e: joshua.b.hanson at gmail.com
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110506/09b4877a/attachment.html>


More information about the riak-users mailing list