On 25/09/13 11:20, Charl Matthee wrote:
Hi,

I am trying to run the following mapreduce query across my cluster:

# curl -XPOST http://10.179.229.209:8098/mapred -H "Content-Type:
application/json" -d '{"inputs":"tweets",
"query":[{"map":{"language":"javascript", "source":"function(value,
keyData, arg) {t = JSON.parse(value.values[0].data)[0]; if ((new Date
- new Date(t.created_at)) / 1000 > 2592000) return [t.id]; else return
[]}", "keep":true}}]}'
{"lineno":466,"message":"SyntaxError: syntax error","source":"()"}

Have you tried executing your javascript outside of Riak?
ie. paste the function into the Chrome debugger, then call it with a Riak-like data structure.

Also, consider wrapping the code in your function with an eval so you can catch errors that occur. (Then either ejslog them or return them as results of the map phase)



_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to