MongoDB Aggregation with C#
Learn how to create aggregation pipelines with C#.
MongoDB Aggregation with C#
Unit Overview
In this unit, you will learn how to perform basic aggregation with C#. First, you will learn what aggregation is and explore the stages and operators of an aggregation pipeline. Next, you'll learn how to build the Match and Group stages of an aggregation pipeline. Finally, you'll learn how to build the Sort and Project stages of an aggregation pipeline.
Prerequisites
Lessons in This Unit
- Lesson 01: Building a MongoDB Aggregation Pipeline in C# Applications
- Lesson 02: Using MongoDB Aggregation Stages with C#:
MatchandGroup - Lesson 03: Using MongoDB Aggregation Stages with C#:
SortandProject
Caleb Thompson | Staff Engineer
Caleb is a Staff Engineer at MongoDB, working primarily on Realm education and documentation. He doesn't recall his life before MongoDB, but has been told he has previously served as an architect, software engineer, API designer, and curriculum design engineer. Caleb also loves teaching, rafting, wood working, and geology.
Parker Faucher | University Curriculum Engineer
Parker is a Curriculum Engineer on the Education team at MongoDB. Prior to joining MongoDB, he helped maintain a world-class developer bootcamp that was offered in multiple universities. He is a self-taught developer who loves being able to give back to the community that has helped him so much.
Daniel Curran | Senior Curriculum Designer
Daniel is a Senior Curriculum Designer at MongoDB. Before joining MongoDB, he worked as an Instructional Designer and Content Developer specializing in technical content for a host of international clients. Daniel's goal is to remove obstacles so learners can feel confident on their journey to become masters of MongoDB.
Hi there and welcome! In this unit, you will learn how to perform basic aggregation with C#.
I’m Caleb. I’m a Staff Engineer here at MongoDB, and I’ll be working with you through this unit.
In this unit, you’ll learn how to create an aggregation pipeline by using builder classes, LINQ, and BsonDocuments.
MongoDB’s Aggregation framework is a powerful tool for filtering, sorting, organizing, and analyzing data without changing any data in your collection.
The lessons in this unit consist of video lectures followed by quiz questions or labs so that you can practice what you learned.
First, we’ll give an overview of aggregation and the stages of an aggregation pipeline.
Then, we’ll explore the Match and Group stages of an aggregation pipeline.
Finally, we’ll explore the Sort and Project stages of an aggregation pipeline.
We will also use the Projections builder classes to project a custom field and value.
Before you begin this unit, you should have a basic understanding of: C#, the MongoDB database, the and document model, and Atlas.
You will also need to set up an Atlas account with a free tier cluster.
By the end of this unit, you will be able to define aggregation and the pipeline stages. You’ll also be able to build an aggregation pipeline by using the Match, Group, Sort, and Project stages.
Let’s get started!