
op.param( name as String ) as literalPlaceholder
This function creates a placeholder for a literal value or a
cts.query
as a search criterion in functions like
op.fromSearch,
op.fromSearchDocs,
or op.where.
The
prototype.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. |
const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');
employees.offsetLimit(op.param('start'), op.param('length'))
.select(['EmployeeID',
op.as('incremented', op.add(op.col('EmployeeID'), op.param('increment')))])
.result(null, {start:1, length:2, increment:1});
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.