MongoDB Query Language (MQL) is the API surface you use to filter, project, update, and aggregate data in collections. This page summarizes the concepts most teams use daily and points to related local guides in this docs set.Documentation Index
Fetch the complete documentation index at: https://mongodb-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
MQL Reference
MQL expressions are BSON-shaped documents. You can use direct field equality, operator documents, or a mix of both:Predicate Patterns
Use these operator families to model common query behavior:- Comparison:
$eq,$ne,$gt,$gte,$lt,$lte - Element:
$exists,$type - Logical:
$and,$or,$nor,$not - Array:
$all,$elemMatch,$size - Evaluation:
$regex,$expr
Projection Patterns
Return only the fields your application needs:Update Expression Basics
Use operator-based updates to mutate documents safely:Aggregation as Extended MQL
Aggregation pipelines are ordered arrays of stages:/docs/reference/manual-core-capabilities#aggregation-operations.