Using Aggregation Operators

1. Using Arithmetic Operators

OperatorEffect
$add, $subtract, $multiply, $divide, $modBasic math
$abs, $ceil, $floor, $round, $truncRounding
$pow, $sqrt, $exp, $ln, $log, $log10Power/log
$sin, $cos, $tan, $asin, $acos, $atan, $atan2Trig

2. Using Comparison Operators

OperatorReturns
$eq, $ne, $gt, $gte, $lt, $lteBoolean
$cmp-1 / 0 / 1

3. Using String Operators

OperatorEffect
$concatConcatenate
$substr, $substrBytes, $substrCPSubstring
$toLower, $toUpperCase
$trim, $ltrim, $rtrimWhitespace
$splitSplit by separator
$strLenBytes, $strLenCPLength
$indexOfBytes, $indexOfCPSearch
$regexMatch, $regexFind, $regexFindAllRegex
$replaceOne, $replaceAllReplace

4. Using Array Operators

OperatorEffect
$sizeArray length
$arrayElemAtElement at index
$first, $lastEnds
$sliceSubarray
$concatArraysConcatenate
$filter, $map, $reduceTransforms
$inElement membership
$zipPair arrays
$rangeGenerate
$sortArraySort inline

5. Using Date Operators

OperatorEffect
$year, $month, $dayOfMonth, $hour, $minute, $second, $millisecondExtract
$dayOfWeek, $dayOfYear, $weekCalendar
$dateAdd, $dateSubtractAdd/subtract intervals
$dateDiffDifference in unit
$dateToStringFormat
$dateFromStringParse
$dateTruncBucket to unit

6. Using Conditional Operators

OperatorForm
$cond[if, then, else]
$ifNull[expr, fallback]
$switch{branches:[{case,then}], default}
$coalesce NEWFirst non-null

7. Using Accumulator Operators

OperatorUse
$sum, $avg, $min, $maxStats
$pushCollect to array
$addToSetUnique collect
$first, $lastBoundary doc
$mergeObjectsMerge subdocs
$stdDevPop, $stdDevSampStd deviation
$accumulatorCustom JS accumulator
$countPer-group count (5.0+)
$topN, $bottomN, $firstN, $lastN, $minN, $maxNTop-N (5.2+)

8. Using Type Conversion

OperatorEffect
$toString, $toInt, $toLong, $toDouble, $toDecimalNumeric/string conversions
$toDate, $toObjectId, $toBoolType conversion
$convertGeneric with onError / onNull
$typeReturn BSON type string

9. Using Set Operators

OperatorEffect
$setUnionUnion
$setIntersectionIntersect
$setDifferenceDifference
$setEqualsEqual as sets
$setIsSubsetSubset?
$anyElementTrue / $allElementsTrueTruthiness

10. Using Object Operators

OperatorEffect
$mergeObjectsMerge documents
$objectToArray{a:1} → [{k:"a",v:1}]
$arrayToObjectInverse
$getField / $setFieldDynamic field access (5.0+)
$unsetFieldRemove field by expression

11. Using Window Operators

StageDetail
$setWindowFieldspartitionBy, sortBy, output with window
Windowdocuments:[N,M] or range:[low,high,unit]
Operators$sum, $avg, $rank, $denseRank, $rowNumber, $shift, $derivative, $integral, $covarianceSamp, $expMovingAvg, $linearFill, $locf
{ $setWindowFields: {
    partitionBy: "$symbol",
    sortBy: { ts: 1 },
    output: { ma7: { $avg: "$price", window: { documents: [-6, 0] } } }
} }