I do this in nodejs all the time using the riak-js package. Here is a modified
map function that I use in production (i added o.fullreturn):
var map = function(v, keydata, args) {
if (v.values) {
var ret = [], o = {};
o.values = Riak.mapValuesJson(v)[0];
o.fullreturn = v;
ret.push(o);
return ret;
} else {
return [];
}
};
-Alexander Sicular
@siculars
On Nov 8, 2013, at 4:04 PM, Dave King <[email protected]> wrote:
> The combination of bucket, key, value and metadata are referred to as
> a “Riak Object” - so says the documentation
>
> http://docs.basho.com/riak/latest/dev/references/http/
>
> The little Riak Book shows a JS Map Reduce Function of
>
> function(raikOjbect,keyData,arg)
>
> so if I return riakObject from this function I'd expect to get the
> meta (links in particular) with the data for the object.
>
> I don't seem to be getting the full Riak Object, just the value(Json
> Document). Am I missing something or doing something wrong? Is there
> anyway to feed the results of a JS map reduce to a Converter in the
> Java API?
>
> - Peace
> Dave
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com