Nearby lessons

13 of 22

📊 MongoDB: Aggregation Pipeline Operators

MongoDB’s Aggregation Framework is used to process data records and return computed results. It works like a data processing pipeline, allowing you to filter, group, sort, and transform documents.

📚 Initial Data Setup

Example01
Loading editor…

1️⃣ $match — Filter Documents

Example02
Loading editor…

2️⃣ $count — Count Documents

Example03
Loading editor…

3️⃣ $sort — Sort Documents

Example04
Loading editor…

4️⃣ $sortByCount — Count and Sort

Example05
Loading editor…

5️⃣ $project — Show Specific Fields

Example06
Loading editor…

6️⃣ $limit — Limit Results

Example07
Loading editor…

7️⃣ $skip — Skip Results

Example08
Loading editor…

8️⃣ $sample — Get Random Documents

Example09
Loading editor…

9️⃣ $group — Group & Aggregate Data

Example10
Loading editor…

🔟 $sum — Count Students per Class

Example11
Loading editor…

1️⃣1️⃣ $max — Find Oldest Student per Class

Example12
Loading editor…

1️⃣2️⃣ $min — Find Youngest Student per Class

Example13
Loading editor…

1️⃣3️⃣ $push — Collect All Names by Class

Example14
Loading editor…

1️⃣4️⃣ $addToSet — Collect Unique Names by Class

Example15
Loading editor…

1️⃣5️⃣ $first — Get First Student per Class

Example16
Loading editor…

1️⃣6️⃣ $last — Get Last Student per Class

Example17
Loading editor…

$top — Top Age Student per Class

Example18
Loading editor…

$topN — Top 2 Students by Age per Class

Example19
Loading editor…

$bottom — Student with Lowest Age per Class

Example20
Loading editor…

$bottomN — Bottom 2 Students by Age per Class

Example21
Loading editor…

Finished this lesson?

Mark it as complete to track your progress and see technology completion stats.