SkillByAIOpen interactive version →

Lesson 13 / 23

The Aggregation Pipeline

Transform data through aggregation pipeline stages such as $match, $group, $sort and $project.

Pipeline of stages

The aggregation pipeline passes documents through an array of stages, each transforming the data before handing it to the next.

Common stages

$match filters documents, $group aggregates by a key, $sort orders results, $project reshapes fields.