POST

Aggregate Data Items


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Runs an aggregation query on the specified data collection and returns the resulting list of items.

Endpoint
POST
{DEPLOYMENT-URI}/v3/items/aggregate
Body Params
collectionIdstringRequired

ID of the collection on which to run the aggregation.


initialFilterstruct

Filter to apply to the collection's data before aggregation. See API Query Language for more information about handling data queries.


aggregationAggregation

Aggregation to apply to the data.


finalFilterstruct

Filter to apply to the processed data after aggregation. See API Query Language for more information about handling data queries.


sortArray <Sorting>

Sorting configuration.


consistentReadbooleanRequired

Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent.


returnTotalCountbooleanRequired

When true, the query response must include the total number of items that match the query.


One Of
Required
Choose one of the following parameters

pagingPaging

cursorPagingCursorPaging
Response Object
itemsArray <object>

Aggregation results. Each result must contain a field for each groupingFields value, and a field for each operations.resultFieldName value.


pagingMetadataPagingMetadata

Paging information.

Aggregation request with an initial filter, aggregation operations, and a final filter.

Request
cURL
Response
JSON
Did this help?