Run Aggregation Pipeline

POST {{URL_ENDPOINT}}/action/aggregate

You can even run aggregation pipelines with the Data API. To do so, use the /aggregate endpoint and specify your pipeline in the pipeline field of the request body.

Request Body

{"dataSource"=>"{{DATA_SOURCE}}", "database"=>"{{DATABASE}}", "collection"=>"{{COLLECTION}}", "pipeline"=>[{"$sort"=>{"age"=>1}}, {"$limit"=>1}]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Access-Control-Request-Headersstring
api-keystring
Acceptstring