Week 21 - Session 1 - Class Project (Week 2) - Mongo Aggregations Pipeline

blog image source
Mongo Aggregations Pipeline; to perform aggregations operations, MongoDB group values from multiple documents together and then perform a variety of operations on grouped data to return a single result. MongoDB has three ways to perform aggregation: the aggregation pipeline, the map-reduce function, and the single purpose aggregation methods, we will focus on aggregation pipeline.

The MongoDB aggregation pipeline consists of stages. Each stage transforms the documents as they pass through the pipeline:
  • `$project` – select, reshape data
  • `$match` – filter data
  • `$group` – aggregate data
  • `$sort` – sorts data
  • `$skip` – skips data
  • `$limit` – limit data
  • `$unwind` – normalizes data

Popular posts from this blog

Week 9 to 12 - Learning with MCR Codes

Week 9 - Session 1 - The Internet, the Web, HTTP