It appears that the Riak MR API can on occasions return a JSON Object,
rather than an Array. This blows up the Ruby client, and I am guessing
probably some other ones. I've opened an issue for the Ruby client. See
https://github.com/basho/riak-ruby-client/issues/67.
I came across the issue while writing an Erlang map phase function to bulk
fetch values while returning their key. The function is:
map_object_key_value({error, notfound}, _, _) -> [];
map_object_key_value(RiakObject, _, _) ->
[{ riak_object:key(RiakObject), riak_object:get_value(RiakObject) }].
It appears that Riak (or mochijson2?) will convert an array of 2 tuples
into a JSON hash when returning the data.
This is actually quite nice, at least for this application, as its exactly
what I want, but it seems is either undocumented or a bug, since clients do
not respond well to it.
Thoughts?
Elias Levy
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com