MongoDB Aggregation Pipeline Operators
Filtering & Reshaping
$match : Filters documents by criteria
$project : Selects/reshapes fields
$addFields : Adds or updates fields
$unset : Removes fields
$replaceRoot : Replaces the root with a specified document
$replaceWith : Alias for $replaceRoot
$redact : Restricts fields dynamically
Grouping & Aggregating
$group : Groups documents by a key with accumulations
$count : Counts number of documents
$bucket : Categorizes into buckets based on ranges
$bucketAuto : Automatically buckets based on document count
$sortByCount : Combines $group + $sort to count group frequencies
Array & Nested Document Handling
$unwind : Splits array fields into multiple documents
Join & Recursive
$lookup : Joins with another collection
$graphLookup : Recursive join (tree or graph structures)
Sorting, Sampling, Pagination
$sort : Sorts documents
$limit : Limits document count
$skip : Skips specified count
$sample : Random sampling
Multi-Stage / Advanced
$facet : Run multiple pipelines in parallel
MongoDB Aggregation Pipeline Operators
$merge : Writes output to a collection (like $out, but safer)
$out : Writes results to a collection (replaces content)
$unionWith : Combines results from other collection(s)
$indexStats : Returns index usage statistics
$currentOp : Returns running operations
$collStats : Collection statistics
$planCacheStats : Info on cached query plans