Aggregate Documents

Run an aggregation pipeline.

post/action/aggregate

Request

  • Base URL
    https://data.mongodb-api.com/app/your-app-id/endpoint/data/v1
  • URL
    https://data.mongodb-api.com/app/your-app-id/endpoint/data/v1/action/aggregate
  • Auth
    • API key in header Authorization
    • or API key in header email and API key in header password
    • or API key in header apiKey
    • or API key in header jwtTokenString

Request body

dataSourcestring required

The name of a linked MongoDB Atlas data source. This is commonly "mongodb-atlas" though it may be different in your App if you chose a different name when you created the data source.

databasestring required

The name of a database in the specified data source.

collectionstring required

The name of a collection in the specified database.

pipelineobject[] required

An array of aggregation stages.

Response

Success

documentsobject[] required

An array that contains the result set of the aggregation.

Changes

No recorded changes to this operation across all 3 revisions of this API.