Duplicates when linkswalking riak using ripple
===

I'm working on a project where I use Riak with Ripple, and I've stumbled on a problem.
For some reason I get duplicates when link-walking a structure of links. When I link walk using curl I don't get the duplicates as far as I can see.

The difference between my curl based link-walk

> curl -v http://127.0.0.1:8098/riak/users/2306403e5177b4716da9df93b67300824aa2fd0e/_,projects,0/_,tasks,1

and my ruby ripple/riak-client based link walk

          result =   Riak::MapReduce.new(self.robject.bucket.client).
                add(self.robject.bucket,self.key).
                link(Riak::WalkSpec.new({:key => 'projects'})).
                link(Riak::WalkSpec.new({:key => 'tasks', :bucket=>'tasks'})).
                map("function(v){ if(!JSON.parse(v.values[0].data).completed) {return [v];} else { return [];} }", {:keep => true}).run

is as far as I can tell the map at the end.

However the result of the map/reduce contains several duplicates. I can't wrap my head around why. Now I've settled for removing the duplicates based on the key, but I wish that the riak result wouldn't contain duplicates, since it seems like waste to remove duplicates at the end.

I've tried the following:

 - Making sure there are no duplicates in the links sets of my ripple objects
 - Loading the data without the map reduce, but the link walk contains duplicate keys.

Any help is appreciated.

