Introduction
The $group stage helps you collect and combine data by categories, like counting or summing values for each group.
Counting how many orders each customer made.
Summing total sales per product.
Finding the average rating for each movie.
Grouping employees by department to find total salaries.