
op:map( $plan as map:map, $mapper as function(item()) as item()* ) as map:map
This method applies the specified function to each row returned by the plan to produce a different result row.
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
let $employees := op:from-view("main", "employees")
return $employees
=> op:order-by("EmployeeID")
=> op:map(function($row as map:map) {
map:with($row, "seconds", floor(seconds-from-dateTime(current-dateTime())))
})
=> op:result()