Loading TOC...

ModifyPlan.prototype.map

ModifyPlan.prototype.map(
   $functionref as String
) as IteratePlan

Summary

This method applies the specified function to each row returned by the plan to produce a different result row.

Parameters
$functionref The function to be applied.

Usage Notes

map is a method of the following classes:

Example


const op = require('/MarkLogic/optic');
const employees = op.fromView("main", "employees");
 
function secondsMapper(result) {
   result.seconds = new Date().getSeconds();
   return result;
}
  
employees.orderBy('EmployeeID')
	        .map(secondsMapper)
	        .result();
 
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.