A newer version of this documentation is available.

View Latest

Analytics Query Parameters

      +

      Common Parameters

      The Couchbase Analytics Service API supports the following parameters in common with the N1QL for Query REST API.

      Parameter Default Values

      statement

      Specifies at least one valid N1QL for Analytics statement to run. (Required.)

      client_context_id

      An identifier passed by the client that is returned verbatim in the query response. Useful for matching a particular query to a specific caller. (Optional.)

      format

      JSON

      JSON, application/x-adm, application/json, application/json;lossless, or text/csv.

      Note that the following values are deprecated in this release and will be removed in a future release: application/x-adm, application/json, application/json;lossless, and text/csv.

      pretty

      FALSE

      TRUE or FALSE. If TRUE, the result will be indented. (Optional.)

      readonly

      FALSE

      TRUE or FALSE. If TRUE, then DDL statements are not allowed (Optional.)

      scan_consistency

      not_bounded

      not_bounded or request_plus. If not_bounded, the query is executed immediately. If request_plus, the required datasets are updated with data available from the Data service at the time of the request before the query is executed.

      scan_wait

      (no timeout)

      An amount and a unit: ns, us, ms, s, m, or h. The maximum time to wait for datasets to be updated before the query is executed.

      timeout

      (no timeout)

      An amount and a unit: ns, us, ms, s, m, or h.

      args

      An array of positional parameter values.

      $<identifier>

      A named parameter value.

      For more information on these common parameters, see Request-Level Parameters.

      The Analytics Service API does not support the prepared parameter.
      The Analytics Service API does not support the at_plus or statement_plus settings for scan consistency.

      Analytics Parameters

      In addition, the Service API supports the following parameters which are unique to Analytics.

      Parameter Default Values

      plan-format

      JSON

      JSON, STRING

      logical-plan

      FALSE

      TRUE, FALSE

      optimized-logical-plan

      TRUE

      TRUE, FALSE

      expression-tree

      FALSE

      TRUE, FALSE

      rewritten-expression-tree

      FALSE

      TRUE, FALSE

      job

      FALSE

      TRUE, FALSE

      max-warnings

      0

      An integer specifying the maximum number of warning messages to be included in the query response.