
AccessPlan.prototype.map( functionref as String ) as IteratePlan
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. |
map is a method of the following classes:
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: Get the most useful answers to questions from the MarkLogic community, or ask your own question.