Aggregate
Execute MongoDb aggregate over your database
Last updated
Was this helpful?
Execute MongoDb aggregate over your database
Last updated
Was this helpful?
When you have a complex query where you need to link more than several collections together, and when you need to calculate, aggregate, sum up, and group the data, you can write aggregate and execute it from the API.
Check the docs on aggregation.
When you have complex query where you need link more than several collections together, and when you need calculate, aggregate, sum up, group the data, then you can write aggregate and execute it from the API. https://docs.codemash.io/api/database/collections/aggregate
/{version}/db/{CollectionName}/aggregate/{id}
Id of an aggregate
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en
When you have complex query where you need link more than several collections together, and when you need calculate, aggregate, sum up, group the data, then you can write aggregate and execute it from the API. https://docs.codemash.io/api/database/collections/aggregate
/{version}/db/{CollectionName}/aggregate/{id}
Id of an aggregate
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en