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});

  
Powered by MarkLogic Server | Terms of Use | Privacy Policy