MongoDB Method: db.collection.aggregate()
Process or calculate aggregated values from a collection or view. The processing steps are mentioned in different stages. We can perform operations like grouping, filtering, and/or any general calculation using the aggregation pipeline.