MongoDB aggregation operators, in plain English. Understand what each supported operator changes, study its smallest useful syntax, then practise it against a connected commerce dataset. Continue learning$match: Keep only the documents that meet a condition.Use it early when later stages should work with a smaller, relevant set of documents. It uses the same query shape as a normal MongoDB find filter.$project: Choose, remove, rename, or calculate output fields.A value of `1` keeps a field and `0` removes it. Assign a field path such as `"$_id"` when you want to rename or copy a value.$sort: Reorder documents by one or more fields.Use `1` for ascending order and `-1` for descending order. Put it before `$limit` when you need the highest or lowest results from the full stream.$limit: Allow only the first number of documents to continue.The current order matters. Limiting before sorting answers a different question from sorting the full stream and then limiting it.$set: Add or replace fields while keeping the rest of the document.Use it when the next stage needs a calculated value but you still want every existing field to remain available. `$set` is an alias for `$addFields`.$unwind: Turn each array element into its own output document.After unwinding `items`, each output document contains one item instead of the whole items array. The surrounding order fields are repeated on every emitted document.$group: Combine documents that share a key into summary documents.The `_id` expression defines the group. Every other output field must use an accumulator such as `$sum` or `$avg`.$bucket: Place numeric values into ranges with boundaries you choose.Each boundary begins an inclusive range and the following boundary ends it. Use `output` accumulators to calculate a count, total, or other measure for each range.$lookup: Join matching documents from another collection.The joined matches are always placed in an array named by `as`. For a one-to-one relationship, `$unwind` that array before reading the joined fields.$facet: Run several independent sub-pipelines on the same input.Each named branch receives the same documents and returns its results as an array. Use it when one response needs several coordinated summaries.$setWindowFields: Calculate across an ordered window without collapsing documents.Choose an optional partition, define the sort order, then add one or more window outputs. Unlike `$group`, the original document grain remains available after this stage.$graphLookup: Follow a relationship recursively through one collection.Start with one value, match it against `connectToField`, then reuse `connectFromField` from every match to continue traversing. Set a maximum depth when the domain has a known bound.$cond: Choose one of two values based on a condition.The array form contains the condition first, the value returned when true second, and the value returned when false third.$gte: Test whether the first value is greater than or equal to the second.Inside an aggregation expression, pass both values in an array. The result is a boolean that can drive `$cond` or another expression.$multiply: Multiply two or more numeric values.Operands can be field paths, fixed numbers, or nested expressions. In the capstone it converts quantity and unit price into line revenue.$dateFromString: Convert a date string into a date value.Use it before date arithmetic, truncation, or chronological window sorting when source data stores a timestamp as text. Production pipelines should also define error handling for uncertain input.$dateTrunc: Normalize a date to the beginning of a time interval.Truncating every event to the same unit creates reliable bucket keys for calendar reports. Specify timezone and week settings explicitly when the business definition requires them.$sum: Add numeric values together.Inside `$group`, `$sum: "$total"` adds a field across documents and `$sum: 1` counts documents. In `$set`, a single array field path can total that array’s numeric values.$avg: Calculate the average of numeric values.Use it inside `$group` when you need a mean for each group. Non-numeric and missing values are ignored rather than counted as zero.$map: Transform every element in an array and return a new array.Choose the input array, give the current element a variable name, and return the expression that should become each new element.$size: Return the number of elements in an array.Use it when the number of array entries matters. The input must resolve to an array, so account for missing or non-array values in production data.$arrayElemAt: Read the array element at a particular position.Indexes begin at `0`; negative indexes count backward from the end. This reads one value without unwinding the entire array.$documentNumber: Assign a sequential number within a sorted window.The number restarts for each partition and follows the order defined by `$setWindowFields`. Use it when every document needs a stable position, including tied sort values.