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();
 
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy