Hi Mat, Yes, a map function may return a three element array with the third element being used as keydata to a subsequent map phase. A quick example:
# create an object curl http://localhost:8098/riak/bucket/key -XPUT -d 'hello' -H 'content-type:text/plain' # example MapReduce query curl http://localhost:8098/mapred -XPOST -H 'content-type:application/json' -d '{"inputs":[["bucket","key"]],"query":[{"map":{"language":"javascript","source":"function(v) { return [[\"bucket\",\"key\",\"keyarg\"]] }"}},{"map":{"language":"javascript","source":"function(v, keyData) { return [keyData] }"}}]}' Thanks, Dan -- Daniel Reverri Developer Advocate Basho Technologies, Inc. [email protected] Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, March 23, 2012 at 8:37 AM, Matthew A. Brown wrote: > For situations in which one map phase passes output to a subsequent > map phase, the documentation states: > > These map functions filter their inputs based on the arg and > return bucket-key pairs for a subsequent map phase > > Is it possible to also return a keyarg? So a three-element array? > > Thanks! > Mat > > _______________________________________________ > riak-users mailing list > [email protected] (mailto:[email protected]) > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
