
AccessPlan.prototype.select( columns as String, [qualifier as String] ) as ModifyPlan
This call projects the specified columns from the current row set and / or applies a qualifier to the columns in the row set. Unlike SQL, a select call is not required in an Optic query.
select is a method of the following classes:
const op = require('/MarkLogic/optic');
op.fromView('main', 'employees')
.select(['EmployeeID', 'FirstName', 'LastName'])
.result();
// Return all of the expenses and expense categories for each employee and return
// results in order of employee number.
const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');
const expenses = op.fromView('main', 'expenses');
const Plan =
employees.joinInner(expenses, op.on(employees.col('EmployeeID'), expenses.col('EmployeeID')))
.select([employees.col('EmployeeID'), 'FirstName', 'LastName', expenses.col('Category'), 'Amount'])
.orderBy(employees.col('EmployeeID'))
Plan.result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.