Loading TOC...

op.param

op.param(
   name as String
) as literalPlaceholder

Summary

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.

Example

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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.