Efficient way of passing multiple arguments to mapreduce functions

Matthew Tovbin matthew at tovbin.com
Tue May 8 19:23:44 EDT 2012


Hi Riak-users,

I'm looking for an efficient way of passing multiple arguments to mapreduce
functions, Instead of
passing a JSON (or other custom string representation of arguments) and
being forced to parse
it on every map/reduce function call, i.e.:

Now:
//Passing:  arg = {"a":"0", "b":"1"}
//Example map function
function(v, kd, arg) {
  var args = JSON.parse(arg).values;
  var a = args[0]; var b = args[1];
  //.....
}

Desired:
//Passing:  arg = {"a":"0", "b":"1"}
//Example map function
function(v, kd, arg) {
  var a = args.a; var b = args.b;
  //.....
}



-Matthew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120508/83067372/attachment.html>


More information about the riak-users mailing list