aggregate

Aggregate over a collection

Aggregates over the objects of a collection. Phase 1 supports counts: the number of matching objects, either in total (flat count response) or per group of a groupBy property (groups response). A where filter limits the objects that are aggregated; an empty body returns the collection's total object count.

post/aggregate/{collection}

Request

  • Base URL: https://localhost:8080/v1
  • URL: https://localhost:8080/v1/aggregate/{collection}
  • Auth: one of:
    • none
    • OAuth 2 (implicit, authorization URL http://to-be-configured-in-the-application-config)

Path parameters

collectionstring required

The name (or alias) of the collection to aggregate over. A lowercase first letter is normalized to the canonical uppercase form.

Request body

groupBystring

The property to group by, as a bare property name. Each distinct value of the property forms one group (an object whose property holds several values counts toward each of them). Omitted or empty aggregates over all matching objects without grouping.

returnMetricsstring[]

The aggregation metrics to return. Phase 1 supports only count (the number of matching objects, per group when groupBy is set); omitted or empty is equivalent to ["count"]. The property-scoped property:statistic grammar (e.g. price:mean) is reserved and returns 422 (not yet supported).

limitinteger nullable

The maximum number of groups to return, largest first. Must be positive and requires groupBy; omitted falls back to the server default (100 groups).

tenantstring

The tenant to aggregate in a multi-tenant collection.

overobject nullable

Reserved for aggregate-over-search (aggregating the results of a vector, keyword or hybrid search). Returns 422 (not yet supported).

objectLimitinteger nullable

Reserved for aggregate-over-search (the maximum number of search results to aggregate). Returns 422 (not yet supported).

Example request

{
  "where": {
    "operator": "GreaterThanEqual",
    "path": [
      "inCity",
      "city",
      "name"
    ],
    "valueInt": 2000,
    "valueNumber": 3.14,
    "valueString": "my search term",
    "valueText": "my search term",
    "valueDate": "TODO",
    "valueNumberArray": [
      3.14
    ],
    "valueBooleanArray": [
      true,
      false
    ],
    "valueStringArray": [
      "my search term"
    ],
    "valueTextArray": [
      "my search term"
    ]
  }
}

Response

Aggregation performed successfully.

countinteger nullable

The number of matching objects. Present only for ungrouped aggregations.

tookMsinteger required

Server-side processing time in milliseconds.

Changes

No recorded changes to this operation across all 1 revision of this API.