Introduction
Advanced stages in MongoDB let you process and analyze data step-by-step. They help you get detailed and useful results from your data.
When you want to filter data and then group it to find totals.
When you need to sort data after calculating new values.
When you want to join data from different collections.
When you want to transform data into a new shape for reports.
When you want to perform calculations on data before showing results.