op.param( name as String ) as literalPlaceholder
This function creates a placeholder for a literal value in an expression or as the offset or max for a limit. The prototype.result function throws in an error if the binding parameter does not specify a literal value for the parameter.
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.