Cardinality Aggregation
Cardinality Aggregation allows you to estimate the number of unique values of fields in a collection, which is often referred to as the count of distinct or unique values.
Example -
In the above example, the aggregation will be performed over the field "unique_products" over all documents that pass the query. The aggregation results will return the number of all possible value of the field "prod_name".
Last updated