For AI agents: a documentation index is available at https://www.mongodb.com/zh-cn/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
See how MongoDB 9.0 delivers up to 2x higher throughput.
MongoDB Branding Shape
Register now >
Docs Menu

Filter Data in an Aggregation Pipeline

This tutorial illustrates how to construct an aggregation pipeline, perform the aggregation on a collection, and display the results using the language of your choice.

The aggregation pipeline in this tutorial performs the following operations:

  • Matches a subset of documents by a field value

  • Formats result documents

The following steps demonstrate how to create and run an aggregation pipeline to filter for a specific subset of documents.