MarkLogic 9 Product Documentation
op:resultop:result(
$plan as map:map,
[$outType as xs:string?],
[$bindings as map:map]
) as xs:string?
Summary
This method executes the plan (mapping or reducing, if specified) to generate the result,
which is a sequence of map:map
or json:array
rows,
unless mapped or reduced to different output.
Parameters |
$plan |
The Optic Plan. You can either use the XQuery
=> chaining operator or specify the variable that captures the
return value from the previous operation.
|
$outType |
This parameter specifies the outputType as either "object" (the default)
for a map:map sequence with keys of the column names and values of the
column values or "array" for a json:array with the list of column
names as an initial header and the column values in the same order for the subsequent rows.
|
$bindings |
This parameter provides a map with the names and
values of placeholder parameters. An error is thrown if a placeholder
parameter is not bound.
|
See Also
Example
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
op:from-view("main", "employees")
=> op:select(("EmployeeID", "FirstName", "LastName"))
=> op:order-by("EmployeeID")
=> op:result()
Copyright © 2024 MarkLogic Corporation. MARKLOGIC is a
registered trademark of MarkLogic Corporation.