Namespace: rows

rows

Provides functions for performing SQL-like, relational operations on MarkLogic data. Enables you to retrieve document data as rows by executing a plan constructed by a planBuilder.

Methods


explain(builtPlan, format) → {Promise}

Returns an explanation of an execution plan as a promise.
Parameters:
Name Type Argument Description
builtPlan object A planBuilder object or a built plan as a JSON object.
format string <optional>
The format of the returned representation: 'json'|'xml'. The default is 'json'.
Since:
  • 2.1.1
Returns:
A promise whose success callback receives the explanation as JSON or XML.
Type
Promise

query(builtPlan, options) → {Promise}

Executes a plan built by a planBuilder and returns a promise data structure.
Parameters:
Name Type Description
builtPlan object A planBuilder object or a built plan defined as a JSON object.
options RowsOptions Options that control how the plan is executed and the results returned.
Since:
  • 2.1.1
Returns:
A Promise.
Type
Promise

queryAsStream(builtPlan, streamType, options) → {ReadableStream}

Executes a plan built by a planBuilder and returns a readable stream data structure.
Parameters:
Name Type Description
builtPlan object A planBuilder object or a built plan defined as a JSON object.
streamType string Type of stream. Possible values: 'chunked'| 'object'|'sequence'. Default: 'chunked'.
options RowsOptions Options that control how the plan is executed and the results returned.
Since:
  • 2.1.1
Returns:
A readable stream.
Type
ReadableStream

Type Definitions


RowsOptions

Specifies how a planBuilder plan is executed, the formatting of the results returned, and variable bindings.
Type:
  • object
Properties:
Name Type Argument Description
format string <optional>
Format of the returned results. Possible values: 'json'|'xml'|'csv'. Default: 'json'.
structure string <optional>
Structure of the output. Possible values: 'object'|'array'. Default: 'object'.
columnTypes string <optional>
Whether to emit column data types on each row or only the column name header. Possible values: 'rows'|'header'. Default: 'rows'.
complexValues string <optional>
Whether complex array, binary, element, object, and text node columns should be serialized inline or as a reference to a separate response part. Possible values: 'inline'|'reference'. Default: 'inline'. Only relevant when results are delivered as an JSON object stream.
bindings object <optional>
Values for placeholder variables within the query plan. You define them with an object whose keys are the names of the variables and whose values are either primitives or objects with a type or lang key and a value key. Bindings are handled the same way as with graphs#sparql and graphs#sparqlUpdate.
timestamp DatabaseClient.Timestamp <optional>
A Timestamp object for point-in-time operations.
Since:
  • 2.1.1
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 3.6.4 on 2020-08-04T23:55:51-07:00 using the DocStrap template.