DocumentDB LogoDocumentDB
HomeGitHubDiscordDocsBlogs
Back to DocumentationMQL Documentation
CommandsAggregationQuery And Write
OperatorsAccumulatorAggregationArithmetic ExpressionArray ExpressionArray QueryArray UpdateBitwiseBitwise QueryBitwise UpdateBoolean ExpressionComparison QueryConditional ExpressionData SizeDate ExpressionElement QueryEvaluation QueryField UpdateGeospatialLogical QueryMiscellaneousObject ExpressionProjectionSet ExpressionTimestamp ExpressionVariable ExpressionWindow
Reference/Commands/Aggregation

MongoDB Query Language (MQL) Aggregation Commands

Aggregation operations process data records and return computed results. They group values from multiple documents, perform operations on the grouped data, and return a single result. Common aggregation tasks include calculating averages, sums, and counts.

aggregate

The `aggregate` command is used to process data records and return computed results. It performs operations on the data, such as filtering, grouping, and sorting, and can transform the data in various ways.

count

The `count` command is used to count the number of documents in a collection that match specific criteria.

distinct

The `distinct` command is used to find the unique values for a specified field across a single collection. This command is useful when you need to identify the set of distinct values for a field without retrieving all the documents or when you need to perform operations like filtering or grouping based on unique values.

Copyright © DocumentDB a Series of LF Projects, LLC. For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.