Link walking

Joshua Hanson joshua.b.hanson at gmail.com
Fri May 6 12:37:40 EDT 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110506/6a36a791/attachment.html>


More information about the riak-users mailing list