$match

Reference type:Cheat sheetFormat:Syntax + example + use case

Reference group: Pipeline stages

What it does

Filters documents using query predicate semantics.

Syntax

{$match: filter}

Use case

Reduce downstream work; place early when semantically valid.

$match: practical example
{ $match: { status: "paid", total: { $gte: 1000 } } }
💡 Explanation Filters documents using query predicate semantics. When to use it Reduce downstream work; place early when semantically valid.
Key Takeaways
  • Filters documents using query predicate semantics.
  • Typical use: Reduce downstream work; place early when semantically valid.