
AccessPlan.prototype.limit( length as String ) as ModifyPlan
This method specifies the maximum number of rows to be returned by this Plan.
| Parameters | |
|---|---|
| length | The maximum number of rows to return. |
limit is a method of the following classes:
// Calculate the total expenses for each employee and return ten results in order
// of employee number.
const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');
const expenses = op.fromView('main', 'expenses');
const totalexpenses = op.col('totalexpenses');
const Plan =
employees.joinInner(expenses, op.on(employees.col('EmployeeID'), expenses.col('EmployeeID')))
.groupBy(employees.col('EmployeeID'), ['FirstName', 'LastName', expenses.col('Category'),
op.sum(totalexpenses, expenses.col('Amount'))])
.orderBy('EmployeeID')
.limit(10)
Plan.result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.