Link walking

Joshua Hanson joshua.b.hanson at
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'messages', 'josh-123', 'secret message', function(err, message) {
#insert people object with link to message we just inserted'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);

So, if I remove the 'link' phase I get the correct object from the map
but if I instead remove the 'map' phase, I get the correct object from link

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list