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.
Docs Menu

Filter Data

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.