Venki,

You don't have to serialize the argument as a JSON string, it can simply be 
specified as a normal JSON data structure, just like the other data in the 
MapReduce request:

curl -v -d '{"inputs":[["artists", "Beatles"]], 
"query":[{"map":{"language":"javascript","source":"function(v, k, a) {return 
[a];}","arg":{"paul": true}}}]}' -H "Content-Type: application/json" 
http://127.0.0.1:8098/mapred

Cheers, Mathias
http://riakhandbook.com





On Wednesday, 4. July 2012 at 07:26, Venki Yedidha wrote:

> Hi all,
> I don't know why, I can't pass a json argument to map function.
> 
> 
> "inputs":"[b1,k1],[b2,k2],[b3,k3]"
> "query":[{map":{"language":"javascript","source":"function(value,keydata,args){}"
> 
> for the args parameter I need to pass json of the form:
> {\"name\":\"venkatesh\",\"age\":24}
> (escaped " for json)
> but it showing missing variable name..
> On the other, If I am passing an array, it is not showing the error...
> Please help me on the above.
> 
> Thanks,
> Venkatesh
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com (mailto:riak-users@lists.basho.com)
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com




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

Reply via email to