ModifyPlan.prototype.result

ModifyPlan.prototype.result(
   outputType as String,
   [bindings as String],
   [traceFlags as String]
) as Plan

Summary

This method executes the plan (mapping or reducing, if specified) to generate the result, which is a plan, document plan, prepared plan, or map or reduce result plan.

Unless otherwise mapped or reduced, each row is returned as a sem.binding object with a property for each column that exists in the row.

Parameters
outputType This parameter specifies the outputType as either "object" (the default) for a JavaScript object with keys of the column names and values of the column values or "array" for a JavaScript array.
bindings This parameter provides a JavaScript literal object with the names and values of placeholder parameters. An error is thrown if a placeholder parameter is not bound.
traceFlags This parameter specifies whether the trace flags (typically, those for the builtins) are enabled while getting results.

Usage Notes

result is a method of the following classes:

See Also

Example


const op = require('/MarkLogic/optic');
 
op.fromView('main', 'employees')orderdef
   .select(['EmployeeID', 'FirstName', 'LastName'])
   .orderBy('EmployeeID')
   .result();
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy