Hi all! I'm working on a map/reduce script but I c...
# suitescript
d
Hi all! I'm working on a map/reduce script but I can't seem to get the context in the summary stage. Is there a trick to getting something written in the map/reduce stage in the summary stage?
for context, I do some record updates in map stage
Copy code
context.write({
    success: true,
    message: 'Record ' + recordId + ' updated successfully'
});
and don't have a reduce stage (i've tried using the reduce stage too to pass the context along) and can't seem to get anything in the summary context
this is what is in the summary context when I log it
Copy code
{
   type: "mapreduce.Summary",
   dateCreated: "2023-05-04T23:03:21.325Z",
   seconds: 11,
   usage: 20,
   concurrency: 1,
   yields: 0
}
a
i mean you can just log that in the map stage if you just want the confirmation of the various record ids
e
Copy code
summaryContext.output.iterator().each((key, value) => {
				log.debug('key', key);
				log.debug('value', value);
                return true;
});
d
@Anthony OConnor no I want to make a CSV file with all the records and results
Thank you @ehcanadian this worked!