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
-
$abs
operator - Accumulator
- Basic accumulation operator
- Add
-
$add
operator - AddFields
-
$addFields
aggregation stage - AddToSet
-
$addToSet
operator -
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
-
$and
operator - ArrayElemAt
-
$arrayElemAt
operator - ArrayToObject
-
$arrayToObject
operator - Avg
-
$avg
operator - Box
- https://docs.mongodb.com/manual/reference/operator/query/box/#mongodb-query-op.-box
- Bucket
-
$bucket
aggregation stage - BucketAuto
-
$bucketAuto
aggregation stage - Builder
- Builder interface
- Case
- Case branch for Switch operator
- Ceil
-
$ceil
operator - 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
-
$cmp
operator - Concat
-
$concat
operator - ConcatArrays
-
$concatArrays
operator - Cond
-
$cond
operator - Const
- Constant expression
- Convert
-
$convert
operator - Count
-
$count
aggregation stage - DateFromParts
-
$dateFromParts
- DateFromString
-
$dateFromString
operator - DateToParts
-
$dateToParts
operator - DayOfMonth
-
$dayOfMonth
operator - DayOfWeek
-
$dayOfWeek
operator - DayOfYear
-
$dayOfYear
operator - Divide
-
$divide
operator - Eq
-
$eq
operator - Exp
-
$exp
operator - Expr
-
$expr
operator - Facet
-
$facet
aggregation stage - Field
- Field path expression
- Filter
-
$filter
operator - First
-
$first
operator - Floor
-
$floor
operator - Geometry
- https://docs.mongodb.com/manual/reference/operator/query/geometry/#mongodb-query-op.-geometry
- GeoNear
-
$geoNear
- Granularity
- Granularity for BucketAuto
- GraphLookup
-
$graphLookup
- Group
-
$group
aggregation stage - Gt
-
$gt
operator - Gte
-
$gte
operator - Hour
-
$hour
operator - IfNull
-
$ifNull
operator - In
-
$in
operator - IndexOfArray
-
$indexOfArray
operator - IndexOfBytes
-
$indexOfBytes
operator - IndexOfCP
-
$indexOfCP
operator - IsArray
-
$isArray
operator - IsoDateFromParts
- ISO date from parts
- IsoDayOfWeek
-
$isoDayOfWeek
operator - IsoWeek
-
$isoWeek
operator - IsoWeekYear
-
$isoWeekYear
operator - Last
-
$last
operator - Let
-
$let
operator - Limit
-
$limit
aggregation stage - Literal
- Literal expression
- Ln
-
$ln
operator - Log
-
$log
operator - Log10
-
$log10
operator - Lookup
-
$lookup
aggregation stage - Lt
-
$lt
operator - Lte
-
lte
operator - Ltrim
-
$ltrim
operator - MapOp
-
$map
operator - Match
-
$match
aggregation stage - Max
-
$max
operator - MergeObjects
-
$mergeObjects
operator - Millisecond
-
$millisecond
operator - Min
-
$min
operator - Minute
-
$minute
operator - Mod
-
$mod
operator - Month
-
$month
operator - Multiply
-
$multiply
operator - Ne
-
$ne
operator - Not
-
$not
operator - ObjectToArray
-
$objectToArray
- Operator
- Basic aggregation operator
- Or
-
$or
operator - Output
- Creates an "output" document for the setWinowsDield stage
- Pow
-
$pow
operator - Project
-
$project
aggregation stage - Push
-
$push
operator - Range
-
$range
operator - Reduce
-
$reduce
operator - RegexFind
-
$regexFind
operator - RegexFindAll
-
$regexFindAll
operator - RegexMatch
-
$regexMatch
operator - ReplaceRoot
-
$replaceRoot
aggregation stage - ReplaceWith
-
$replaceWith
aggregation stage - ReverseArray
-
$reverseArray
operator - Round
-
$round
operator - Rtrim
-
$rtrim
operator - Sample
-
$sample
aggregation stage - Second
-
$second
operator - SetStage
-
$set
aggregation stage - SetWindowFields
-
$setWindowFields
aggregation stage - ShapeOperator
- There is
- Size
-
$size
operator - Skip
-
$skip
aggregation stage - Slice
-
$slice
operator - Sort
-
$sort
aggregation stage - SortByCount
-
$sortByCount
- Split
-
$split
operator - Sqrt
-
$sqrt
operator - StdDevPop
-
$stdDevPop
operator - StdDevSamp
-
$stdDevSamp
operator - StrCaseCmp
-
$strcasecmp
operator - StrLenBytes
-
$strLenBytes
operator - StrLenCP
-
$strLenCP
operator - SubstrBytes
-
$substrBytes
operator - SubstrCP
-
$substrCP
operator - Subtract
-
$subtract
operator - Sum
-
$sum
operator - Switch
-
$switch
operator - ToBool
-
$toBool
operator - ToDate
-
$toDate
operator - ToDecimal
-
$toDecimal
operator - ToDouble
-
$toDouble
operator - ToInt
-
$toInt
operator - ToLong
-
$toLong
operator - ToLower
-
$toLower
operator - ToObjectId
-
$toObjectId
operator - ToString
-
$toString
operator - ToUpper
-
$toUpper
operator - Trim
-
$trim
operator - Trunc
-
$trunc
operator - Type
-
$type
operator - UnionWith
-
$unionWith
aggregation stage - Unset
-
$unset
aggregation stage - Unwind
-
$unwind
aggregation stage - Var
- Aggregation expression's variable
- Week
-
$week
operator - Year
-
$year
operator - Zip
-
$zip
operator