Riak.mapValuesJson is returning a string

kodeblok nucleardragoninc at gmail.com
Thu Apr 26 14:54:24 EDT 2012


I am using curl to execute a map query. My command is this:

curl -v -d '{"inputs":[["test", "120000"]],
"query":[{"map":{"language":"javascript", "source":"function(value, keyData,
arg) { var dats = Riak.mapValuesJson(value)[0]; return [typeof dats];}"}}]}'
-H "Content-Type: application/json" http://127.0.0.1:8098/mapred

The result is this: ["string"]
and I expected it to be an object. I can't access the values of 'dats' with
sub access or dot access.

I've double checked that this is saved in Riak as JSON with this:

curl -v http://127.0.0.1:8098/riak/test/120000

and received this in the response:

Content-Type: application/json
Content-Length: 2343

and the response is obviously an escaped JSON string ala:
"{\"foo\":{\"version\":\"1.0\",.....}}

Has anyon ehad this issue? How did you resolve it?

Thanks!

--
View this message in context: http://riak-users.197444.n3.nabble.com/Riak-mapValuesJson-is-returning-a-string-tp3942213p3942213.html
Sent from the Riak Users mailing list archive at Nabble.com.




More information about the riak-users mailing list