# Pipeline Basics

Pipeline Basics: The Aggregation Pipeline: Data on a Conveyor Belt, $group: Totals, Counts and Averages, Shaping the Report: $project, $set, $sort and $limit.

Updated: November 19, 2026

1. [The Aggregation Pipeline: Data on a Conveyor Belt](https://www.ask-codey.com/lessons/mongodb-aggregation-pipeline) (Apprentice): An aggregation pipeline sends a collection's documents through a list of stages, each doing one job, so the database can answer report questions that find can't, starting with $match to choose the documents and $count to count them.
2. [$group: Totals, Counts and Averages](https://www.ask-codey.com/lessons/mongodb-aggregation-group) (Journeyman): The $group stage sorts documents into groups by the value of a field, or puts them all in one group, and computes each group's total, count, average, smallest, biggest and first value with accumulators.
3. [Shaping the Report: $project, $set, $sort and $limit](https://www.ask-codey.com/lessons/mongodb-aggregation-project-sort-limit) (Journeyman): Four stages turn a pipeline's correct answer into a report someone can read, $sort and $limit for the top few, $project to choose and rename fields, and $set to compute new ones with expressions such as $multiply and $round, and the order of the stages changes what comes out.

Source: https://www.ask-codey.com/courses/mongodb-in-depth/topics/mongodb-pipeline-basics
