
op:param( $name as xs:string ) as map:map
This function creates a placeholder for a literal value or a
cts:query
as a search criterion in functions like
op:from-search,
op:from-search-docs,
or op:where.
The
op:result
function throws in an error if the binding parameter does not specify a
value for the placeholder.
| Parameters | |
|---|---|
| $name | The name of the parameter. |
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:offset-limit(op:param('start'), op:param('length'))
=> op:select(('EmployeeID',
op:as('incremented',
op:add(op:col('EmployeeID'),
op:param('increment')))))
=> op:result((), map:entry("start",1)
=> map:with("length",2)
=> map:with("increment",1))