how do you pass the number of records processed fr...
# suitescript
r
how do you pass the number of records processed from reduce to the summarize stage in a map reduce script?
j
you can use context.write in the reduce stage to pass information to the summarize stage
Copy code
// end of reduce stage
context.write(context.key, { someValue: 5, anotherValue: "hello" });

function summarize(context) {
  context.output.iterator().each(function(key, 
    log.debug(key, val);
    return true;
  });
}