mongo_aggregation library
Mongodb aggregation library
Simplifies to create aggregation pipelines using Dart code.
Basic usage:
final db = Db('mongodb://127.0.0.1/testdb');
final pipeline = AggregationPipelineBuilder()
.addStage(
Match(where.eq('status', 'A').map['\$query']))
.addStage(
Group(
id: Field('cust_id'),
fields: {
'total': Sum(Field('amount'))
}
)).build();
final result =
await DbCollection(db, 'orders')
.aggregateToStream(pipeline).toList();
Full mongoDB documentation on aggregation queries: https://docs.mongodb.com/manual/aggregation/
Classes
- Abs
-
$absoperator - Accumulator
- Basic accumulation operator
- Add
-
$addoperator - AddFields
-
$addFieldsaggregation stage - AddToSet
-
$addToSetoperator -
AEIterator<
T> - Iterator for AEList
- AEList
- Aggregation expression's list
- AEObject
- Aggregation expression's object
- AggregationExpr
- Aggregation expression
- AggregationPipelineBuilder
- Aggregation pipeline builder
- AggregationStage
- Aggregation stage base
- And
-
$andoperator - ArrayElemAt
-
$arrayElemAtoperator - ArrayToObject
-
$arrayToObjectoperator - Avg
-
$avgoperator - Box
- https://docs.mongodb.com/manual/reference/operator/query/box/#mongodb-query-op.-box
- Bucket
-
$bucketaggregation stage - BucketAuto
-
$bucketAutoaggregation stage - Builder
- Builder interface
- Case
- Case branch for Switch operator
- Ceil
-
$ceiloperator - Center
- https://docs.mongodb.com/manual/reference/operator/query/box/#mongodb-query-op.-box
- CenterSphere
- https://docs.mongodb.com/manual/reference/operator/query/box/#mongodb-query-op.-box
- Cmp
-
$cmpoperator - Concat
-
$concatoperator - ConcatArrays
-
$concatArraysoperator - Cond
-
$condoperator - Const
- Constant expression
- Convert
-
$convertoperator - Count
-
$countaggregation stage - DateFromParts
-
$dateFromParts - DateFromString
-
$dateFromStringoperator - DateToParts
-
$dateToPartsoperator - DayOfMonth
-
$dayOfMonthoperator - DayOfWeek
-
$dayOfWeekoperator - DayOfYear
-
$dayOfYearoperator - Divide
-
$divideoperator - Eq
-
$eqoperator - Exp
-
$expoperator - Expr
-
$exproperator - Facet
-
$facetaggregation stage - Field
- Field path expression
- Filter
-
$filteroperator - First
-
$firstoperator - Floor
-
$flooroperator - Geometry
- https://docs.mongodb.com/manual/reference/operator/query/geometry/#mongodb-query-op.-geometry
- GeoNear
-
$geoNear - Granularity
- Granularity for BucketAuto
- GraphLookup
-
$graphLookup - Group
-
$groupaggregation stage - Gt
-
$gtoperator - Gte
-
$gteoperator - Hour
-
$houroperator - IfNull
-
$ifNulloperator - In
-
$inoperator - IndexOfArray
-
$indexOfArrayoperator - IndexOfBytes
-
$indexOfBytesoperator - IndexOfCP
-
$indexOfCPoperator - IsArray
-
$isArrayoperator - IsoDateFromParts
- ISO date from parts
- IsoDayOfWeek
-
$isoDayOfWeekoperator - IsoWeek
-
$isoWeekoperator - IsoWeekYear
-
$isoWeekYearoperator - Last
-
$lastoperator - Let
-
$letoperator - Limit
-
$limitaggregation stage - Literal
- Literal expression
- Ln
-
$lnoperator - Log
-
$logoperator - Log10
-
$log10operator - Lookup
-
$lookupaggregation stage - Lt
-
$ltoperator - Lte
-
lteoperator - Ltrim
-
$ltrimoperator - MapOp
-
$mapoperator - Match
-
$matchaggregation stage - Max
-
$maxoperator - MergeObjects
-
$mergeObjectsoperator - Millisecond
-
$millisecondoperator - Min
-
$minoperator - Minute
-
$minuteoperator - Mod
-
$modoperator - Month
-
$monthoperator - Multiply
-
$multiplyoperator - Ne
-
$neoperator - Not
-
$notoperator - ObjectToArray
-
$objectToArray - Operator
- Basic aggregation operator
- Or
-
$oroperator - Output
- Creates an "output" document for the setWinowsDield stage
- Pow
-
$powoperator - Project
-
$projectaggregation stage - Push
-
$pushoperator - Range
-
$rangeoperator - Reduce
-
$reduceoperator - RegexFind
-
$regexFindoperator - RegexFindAll
-
$regexFindAlloperator - RegexMatch
-
$regexMatchoperator - ReplaceRoot
-
$replaceRootaggregation stage - ReplaceWith
-
$replaceWithaggregation stage - ReverseArray
-
$reverseArrayoperator - Round
-
$roundoperator - Rtrim
-
$rtrimoperator - Sample
-
$sampleaggregation stage - Second
-
$secondoperator - SetStage
-
$setaggregation stage - SetWindowFields
-
$setWindowFieldsaggregation stage - ShapeOperator
- There is
- Size
-
$sizeoperator - Skip
-
$skipaggregation stage - Slice
-
$sliceoperator - Sort
-
$sortaggregation stage - SortByCount
-
$sortByCount - Split
-
$splitoperator - Sqrt
-
$sqrtoperator - StdDevPop
-
$stdDevPopoperator - StdDevSamp
-
$stdDevSampoperator - StrCaseCmp
-
$strcasecmpoperator - StrLenBytes
-
$strLenBytesoperator - StrLenCP
-
$strLenCPoperator - SubstrBytes
-
$substrBytesoperator - SubstrCP
-
$substrCPoperator - Subtract
-
$subtractoperator - Sum
-
$sumoperator - Switch
-
$switchoperator - ToBool
-
$toBooloperator - ToDate
-
$toDateoperator - ToDecimal
-
$toDecimaloperator - ToDouble
-
$toDoubleoperator - ToInt
-
$toIntoperator - ToLong
-
$toLongoperator - ToLower
-
$toLoweroperator - ToObjectId
-
$toObjectIdoperator - ToString
-
$toStringoperator - ToUpper
-
$toUpperoperator - Trim
-
$trimoperator - Trunc
-
$truncoperator - Type
-
$typeoperator - UnionWith
-
$unionWithaggregation stage - Unset
-
$unsetaggregation stage - Unwind
-
$unwindaggregation stage - Var
- Aggregation expression's variable
- Week
-
$weekoperator - Year
-
$yearoperator - Zip
-
$zipoperator