Venki,
>From what I gather you're trying to specify arguments directly as objects in
>the function's argument list? You reference the arg that's passed into the
>MapReduce request by declaring a third parameter variable, not by specifying
>an object: function(value, keydata, arg) {doSomethingWi
Thanks again,
I changed args to arg.
To keep it simple, I just want to use that arg parameter value
{"gender":"G0,G1","
agegroups":"A0,A2","metrics":"users,cpc_median","groupby":"country"} inside
my javascript function.
If I try to assign it to a variable like:
var k = arg;
It is givin
Venki,
The parameter name is arg not args. Also, you were talking about some sort of
error you're getting, but I couldn't see one in the listing below.
Cheers, Mathias
http://riakhandbook.com
On Thursday, 5. July 2012 at 16:29, Venki Yedidha wrote:
> Thanks,
> I tried the format you sent m
Thanks,
I tried the format you sent me earlier but when I tried to access the
args parameter inside the function, it is showing me the error:
{"inputs":['.$k.'],"query":[{"map":{"language":"javascript","source":"function(value,keydata,"arguments"){
var data = Riak.mapValuesJson(value)[0];
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)