Namespace: BuiltQuery

valuesBuilder. BuiltQuery

An object representing the result of building a query using the helper functions of a valuesBuilder. You must call the valuesBuilder#fromIndexes function to create the initial BuiltQuery for the values query before calling the functions to specify the other clauses of the built query.

Methods


aggregates(functions) → {valuesBuilder.BuiltQuery}

Specifies aggregates to calculate over the tuples (aka rows) projected from the indexes for the documents selected by the where clause. This function must be called on the builtQuery returned by the valuesBuilder#valuesFromIndexes function or another function specifying a values query clause.
Parameters:
Name Type Description
functions Array.<string> one or more built-in functions such avg, correlation, count, covariance, covariance-population, max, median, min, stddev, stddev-population, sum, variance, or variance-population or the return values from the valuesBuilder#udf function specifying a user-defined aggregate function.
Since:
  • 1.0
Returns:
a built query
Type
valuesBuilder.BuiltQuery

slice(start, length, transform) → {valuesBuilder.BuiltQuery}

Sets the slice clause of a built query to select the slice of the result set based on the first tuple and the number of tuples (aka rows). This function must be called on the builtQuery returned by the valuesBuilder#valuesFromIndexes function or another function specifying a values query clause.
Parameters:
Name Type Argument Description
start number the one-based position within the result set of the first tuple.
length number the number of tuples in the slice.
transform transform <optional>
a transform to apply to the slice on the server as specified by the valuesBuilder#transform function.
Since:
  • 1.0
Returns:
a built query
Type
valuesBuilder.BuiltQuery

where(query) → {valuesBuilder.BuiltQuery}

Sets the where clause of a values query, using the helper functions of a valuesBuilder to specify a structured query. This function must be called on the builtQuery returned by the valuesBuilder#valuesFromIndexes function or another function specifying a values query clause.
Parameters:
Name Type Description
query queryBuilder.Query one or more composable queries returned by the values query builder functions.
Since:
  • 1.0
Returns:
a built query
Type
valuesBuilder.BuiltQuery

withOptions(forestNames, values) → {valuesBuilder.BuiltQuery}

Sets the withOptions clause of a built query to configure the query; takes a configuration object with the following named parameters. This function must be called on the builtQuery returned by the valuesBuilder#valuesFromIndexes function or another function specifying a values query clause.
Parameters:
Name Type Argument Description
forestNames string <optional>
<repeatable>
the names of forests providing documents for the result set
values string <optional>
<repeatable>
options modifying the default behaviour of the query
Since:
  • 1.0
Returns:
a built query
Type
valuesBuilder.BuiltQuery
Copyright 2014-2017 MarkLogic Corporation Documentation generated by JSDoc 3.4.3 on 2017-05-03T15:00:56-07:00 using the DocStrap template.