Suggest an editImprove this articleRefine the answer for “What does a stage mean in aggregation?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A stage in MongoDB's aggregation is a single step in the data-processing pipeline that performs a specific action on the input documents and then passes the result to the next stage: for example, `$match` filters, `$group` groups, `$sort` sorts. **Key point:** each stage's result flows immediately to the next one in the pipeline - a stage is a single operation inside the aggregation pipeline, and each one has a strictly defined job to do with the data stream.Shown above the full answer for quick recall.Answer (EN)ImageA stage in MongoDB's aggregation is **a single step in the data-processing pipeline** that performs a specific action on the input documents and then passes the result to the next stage. ### How to think about it - there's a stream of documents - a stage does something to that stream (filters, sorts, groups, and so on) - the result immediately moves on down the pipeline ### Examples of stages | Stage | What it does | |---|---| | `$match` | filters data | | `$group` | grouping and aggregate calculations | | `$sort` | sorting | | `$project` | selecting and transforming fields | | `$limit` | limiting the number of documents | ### A mini example ```js [ { $match: { status: "active" } }, { $sort: { created_at: -1 } } ] ``` 1. `$match` keeps only the documents you need 2. `$sort` sorts the ones that are left ### The main idea A stage is **a single operation inside the aggregation pipeline**, and every stage has a strictly defined job to do with the data stream.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.