← All tutorials

GoCareerGo Tutorials

MongoDB Tutorial

Documents, collections, CRUD, aggregation, Atlas and driver connectivity.

Aggregation Framework Overview

A declarative pipeline for transforming, filtering and summarizing data — MongoDB's answer to SQL's GROUP BY/JOIN/HAVING.

  • Each stage takes the output of the previous stage as its input
  • Stages run in the order they're written — put $match early to filter down data fast
  • Can fully replace many application-side JOIN + aggregate logic