MongoDB C# docs
GitHub.NET DriverMongoDB docs
  • ⭐Introduction
  • πŸ“ŒGetting started
    • Environment setup
    • πŸƒβ€β™‚οΈ Quick start
      • MongoDB connection
      • Databases
      • Collections
      • Insert documents
      • Read documents
      • Update documents
  • πŸ“‘CRUD Basics
    • βž•Create
      • Id Member
      • Ordered insert
    • πŸ”ŽRead
      • Basics
      • Comparison Operators
      • Logical Operators
      • Element Operators
      • Array operators
      • Evaluation Operators
    • πŸ“Update
      • Operators
      • Replace
      • Arrays
    • ❌Delete
  • πŸ§ͺAggregation
    • Overview
    • βœ‚οΈProject
    • 🎯Match
    • πŸ“¦Group
    • 🚩Unwind
    • ⏩Pagination
    • πŸ“ˆBucket
    • ✨Operators
Powered by GitBook
On this page
  • Aggregation framework
  • Pipeline
  1. Aggregation

Overview

PreviousDeleteNextProject

Last updated 5 years ago

Aggregation framework

Aggregation framework in MongoDB is a powerful feature that allows you to build complex queries that you normally cannot build with the common operators and functions. The framework achieves this by putting your documents into a multi-stage pipeline that transforms the documents in the desired result.

Pipeline

The pipeline consists of a series of where each stage receives the output of the previous stage. The section contains samples for the following stages:

Stage

Description

Project

Adds new fields or removes existing ones

Match

Filters the documents

Group

Groups documents by an identifier expression providing accumulator results

Unwind

Deconstructs an array field

Pagination (limit, skip)

Skips the first n documents and limits the total results

Bucket

Produces a distribution among documents based on a specified expression and specified boundaries

πŸ§ͺ
stages
Aggregation framework