object AggregationFramework extends commands.AggregationFramework[GenericCollection.pack.type] with PackSupport[GenericCollection.pack.type]
The aggregation framework for this collection
- Alphabetic
- By Inheritance
- AggregationFramework
- PackSupport
- AggregationFramework
- AtlasSearchAggregation
- ChangeStreamAggregation
- AggregationPipeline
- SortAggregation
- SliceAggregation
- GroupAggregation
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class AddFieldToSet extends commands.AggregationFramework.GroupFunction
The $addToSet group accumulator.
The $addToSet group accumulator.
- Definition Classes
- GroupAggregation
- final class AddToSet extends commands.AggregationFramework.GroupFunction
The $addToSet group accumulator.
The $addToSet group accumulator.
- Definition Classes
- GroupAggregation
- final class Ascending extends commands.AggregationFramework.SortOrder
Ascending sort order
Ascending sort order
- Definition Classes
- SortAggregation
- final class AtlasSearch extends commands.AggregationFramework.PipelineOperator
EXPERIMENTAL: See AtlasSearch$
EXPERIMENTAL: See AtlasSearch$
- Definition Classes
- AtlasSearchAggregation
- final class Avg extends commands.AggregationFramework.GroupFunction
The $avg group accumulator.
The $avg group accumulator.
- Definition Classes
- GroupAggregation
- final class AvgField extends commands.AggregationFramework.GroupFunction
The $avg group accumulator.
The $avg group accumulator.
- Definition Classes
- GroupAggregation
- final class Descending extends commands.AggregationFramework.SortOrder
Descending sort order
Descending sort order
- Definition Classes
- SortAggregation
- final class First extends commands.AggregationFramework.GroupFunction
The $field group accumulator.
The $field group accumulator.
- Definition Classes
- GroupAggregation
- final class FirstField extends commands.AggregationFramework.GroupFunction
The $field group accumulator.
The $field group accumulator.
- Definition Classes
- GroupAggregation
- sealed trait GroupFunction extends AnyRef
Represents one of the group/accumulator operators, for the
$group
aggregation.Represents one of the group/accumulator operators, for the
$group
aggregation. Operation.- Definition Classes
- GroupAggregation
- See also
https://docs.mongodb.com/manual/reference/operator/aggregation/group/#accumulator-operator
- final class Last extends commands.AggregationFramework.GroupFunction
The $field group accumulator.
The $field group accumulator.
- Definition Classes
- GroupAggregation
- final class LastField extends commands.AggregationFramework.GroupFunction
The $field group accumulator.
The $field group accumulator.
- Definition Classes
- GroupAggregation
- final class Max extends commands.AggregationFramework.GroupFunction
The $max group accumulator.
The $max group accumulator.
- Definition Classes
- GroupAggregation
- final class MaxField extends commands.AggregationFramework.GroupFunction
The $max group accumulator.
The $max group accumulator.
- Definition Classes
- GroupAggregation
- final class MergeObjects extends commands.AggregationFramework.GroupFunction
The $mergeObjects group accumulator.
The $mergeObjects group accumulator.
- Definition Classes
- GroupAggregation
- sealed trait MetadataKeyword extends AnyRef
- Definition Classes
- SortAggregation
- final class MetadataSort extends commands.AggregationFramework.SortOrder
Metadata sort order.
Metadata sort order.
- Definition Classes
- SortAggregation
- final class Min extends commands.AggregationFramework.GroupFunction
The $min group accumulator.
The $min group accumulator.
- Definition Classes
- GroupAggregation
- final class MinField extends commands.AggregationFramework.GroupFunction
The $min group accumulator.
The $min group accumulator.
- Definition Classes
- GroupAggregation
- type Pipeline = List[PipelineOperator]
Aggregation pipeline (with at least one stage operator)
Aggregation pipeline (with at least one stage operator)
- Definition Classes
- AggregationPipeline
- trait PipelineOperator extends AnyRef
One of MongoDBs pipeline operators for aggregation.
One of MongoDBs pipeline operators for aggregation. Sealed as these are defined in the MongoDB specifications, and clients should not have custom operators.
- Definition Classes
- AggregationPipeline
- final class Push extends commands.AggregationFramework.GroupFunction
The $push group accumulator.
The $push group accumulator.
- Definition Classes
- GroupAggregation
- final class PushField extends commands.AggregationFramework.GroupFunction
The $push group accumulator.
The $push group accumulator.
- Definition Classes
- GroupAggregation
- final class SearchString extends AnyRef
EXPERIMENTAL: One or at least one string
EXPERIMENTAL: One or at least one string
- Definition Classes
- AtlasSearchAggregation
- final class Slice extends commands.AggregationFramework.PipelineOperator
Returns a slice/subset of an array.
Returns a slice/subset of an array.
- Definition Classes
- SliceAggregation
- sealed trait SortOrder extends AnyRef
Represents that a field should be sorted on, as well as whether it should be ascending or descending.
Represents that a field should be sorted on, as well as whether it should be ascending or descending.
- Definition Classes
- SortAggregation
- final class StdDevPop extends commands.AggregationFramework.GroupFunction
The $stdDevPop group accumulator.
The $stdDevPop group accumulator.
- Definition Classes
- GroupAggregation
- Since
MongoDB 3.2
- final class StdDevPopField extends commands.AggregationFramework.GroupFunction
The $stdDevPop for a single field.
The $stdDevPop for a single field.
- Definition Classes
- GroupAggregation
- Since
MongoDB 3.2
- final class StdDevSamp extends commands.AggregationFramework.GroupFunction
The $stdDevSamp group accumulator
The $stdDevSamp group accumulator
- Definition Classes
- GroupAggregation
- Since
MongoDB 3.2
- final class StdDevSampField extends commands.AggregationFramework.GroupFunction
The $stdDevSamp for a single field
The $stdDevSamp for a single field
- Definition Classes
- GroupAggregation
- Since
MongoDB 3.2
- final class Sum extends commands.AggregationFramework.GroupFunction
The $sum group accumulator.
The $sum group accumulator.
- Definition Classes
- GroupAggregation
- final class SumField extends commands.AggregationFramework.GroupFunction
The $sum group accumulator.
The $sum group accumulator.
- Definition Classes
- GroupAggregation
- final class SumValue extends commands.AggregationFramework.GroupFunction
- Definition Classes
- GroupAggregation
- final class AddFields extends (AggregationFramework.this)#PipelineOperator
$addFields stage .
$addFields stage .
- Definition Classes
- AggregationFramework
- final class Bucket extends (AggregationFramework.this)#PipelineOperator
$bucket aggregation stage .
$bucket aggregation stage .
- Definition Classes
- AggregationFramework
- final class BucketAuto extends (AggregationFramework.this)#PipelineOperator
$bucket aggregation stage .
$bucket aggregation stage .
- Definition Classes
- AggregationFramework
- final class CollStats extends (AggregationFramework.this)#PipelineOperator
$collStats aggregation stage .
$collStats aggregation stage .
- Definition Classes
- AggregationFramework
- final class Count extends (AggregationFramework.this)#PipelineOperator
$count of the number of documents input .
$count of the number of documents input .
- Definition Classes
- AggregationFramework
- final class CurrentOp extends (AggregationFramework.this)#PipelineOperator
- Definition Classes
- AggregationFramework
- final class Cursor extends AnyRef
- Attributes
- protected
- Definition Classes
- AggregationFramework
- final class Facet extends (AggregationFramework.this)#PipelineOperator
$facet .
$facet .
- Definition Classes
- AggregationFramework
- final class Filter extends AnyRef
The $filter aggregation stage.
The $filter aggregation stage.
- Definition Classes
- AggregationFramework
- final class GeoNear extends (AggregationFramework.this)#PipelineOperator
$geoNear aggregation stage, that outputs documents in order of nearest to farthest from a specified point.
$geoNear aggregation stage, that outputs documents in order of nearest to farthest from a specified point.
- Definition Classes
- AggregationFramework
- final class GraphLookup extends (AggregationFramework.this)#PipelineOperator
The $graphLookup aggregation stage.
The $graphLookup aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4
- final class Group extends (AggregationFramework.this)#PipelineOperator
$groups documents together to calculate aggregates on document collections .
$groups documents together to calculate aggregates on document collections .
- Definition Classes
- AggregationFramework
- final class GroupField extends (AggregationFramework.this)#PipelineOperator
$groups documents together to calculate aggregates on document collections.
$groups documents together to calculate aggregates on document collections. This command aggregates on one field.
- Definition Classes
- AggregationFramework
- final class GroupMulti extends (AggregationFramework.this)#PipelineOperator
$groups documents together to calculate aggregates on document collections.
$groups documents together to calculate aggregates on document collections. This command aggregates on multiple fields, and they must be named.
- Definition Classes
- AggregationFramework
- final class IndexStatAccesses extends AnyRef
- Definition Classes
- AggregationFramework
- final class IndexStatsResult extends AnyRef
- Definition Classes
- AggregationFramework
- final class Limit extends (AggregationFramework.this)#PipelineOperator
$limits the number of documents that pass through the stream.
$limits the number of documents that pass through the stream.
- Definition Classes
- AggregationFramework
- final class ListLocalSessions extends (AggregationFramework.this)#PipelineOperator
$listLocalSessions aggregation stage.
$listLocalSessions aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.6
- final class ListSessions extends (AggregationFramework.this)#PipelineOperator
$listSessions aggregation stage.
$listSessions aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.6
- final class Lookup extends (AggregationFramework.this)#PipelineOperator
Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing .
Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing .
- Definition Classes
- AggregationFramework
- See also
- final class LookupPipeline extends (AggregationFramework.this)#PipelineOperator
Performs an uncorrelated lookup .
Performs an uncorrelated lookup .
- Definition Classes
- AggregationFramework
- See also
- final class Match extends (AggregationFramework.this)#PipelineOperator
Filters out documents from the stream that do not match the predicate.
Filters out documents from the stream that do not match the predicate.
- Definition Classes
- AggregationFramework
- final class Merge extends (AggregationFramework.this)#PipelineOperator
$merge aggregation stage.
$merge aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 4.2
- final class Out extends (AggregationFramework.this)#PipelineOperator
Takes the documents returned by the aggregation pipeline and writes them to a specified collection
Takes the documents returned by the aggregation pipeline and writes them to a specified collection
- Definition Classes
- AggregationFramework
- final class Project extends (AggregationFramework.this)#PipelineOperator
Reshapes a document stream by renaming, adding, or removing fields.
Reshapes a document stream by renaming, adding, or removing fields. Also uses Project to create computed values or sub-objects.
- Definition Classes
- AggregationFramework
- final class Redact extends (AggregationFramework.this)#PipelineOperator
Restricts the contents of the documents based on information stored in the documents themselves.
Restricts the contents of the documents based on information stored in the documents themselves. http://docs.mongodb.org/manual/reference/operator/aggregation/redact/#pipe._S_redact Redact
- Definition Classes
- AggregationFramework
- final class ReplaceRoot extends (AggregationFramework.this)#PipelineOperator
Promotes a specified document to the top level and replaces all other fields.
Promotes a specified document to the top level and replaces all other fields. The operation replaces all existing fields in the input document, including the _id field. https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot
- Definition Classes
- AggregationFramework
- final class ReplaceRootField extends (AggregationFramework.this)#PipelineOperator
Promotes a specified document to the top level and replaces all other fields.
Promotes a specified document to the top level and replaces all other fields. The operation replaces all existing fields in the input document, including the _id field. https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot
- Definition Classes
- AggregationFramework
- final class ReplaceWith extends (AggregationFramework.this)#PipelineOperator
The $replaceWith aggregation stage.
The $replaceWith aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 4.2
- final class Sample extends (AggregationFramework.this)#PipelineOperator
$sample aggregation stage, that randomly selects the specified number of documents from its input.
$sample aggregation stage, that randomly selects the specified number of documents from its input.
- Definition Classes
- AggregationFramework
- final class Set extends (AggregationFramework.this)#PipelineOperator
$set aggregation stage
$set aggregation stage
- Definition Classes
- AggregationFramework
- final class Skip extends (AggregationFramework.this)#PipelineOperator
$skips over a number of documents before passing all further documents along the stream.
$skips over a number of documents before passing all further documents along the stream.
- Definition Classes
- AggregationFramework
- final class Sort extends (AggregationFramework.this)#PipelineOperator
$sorts the stream based on the given fields.
$sorts the stream based on the given fields.
- Definition Classes
- AggregationFramework
- final class SortByCount extends (AggregationFramework.this)#PipelineOperator
The $sortByCount aggregation stage.
The $sortByCount aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4
- final class SortByFieldCount extends (AggregationFramework.this)#PipelineOperator
The $sortByCount aggregation stage.
The $sortByCount aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4
- final class Unset extends (AggregationFramework.this)#PipelineOperator
The $unset aggregation stage.
The $unset aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 4.2
- sealed trait Unwind extends (AggregationFramework.this)#PipelineOperator
- Definition Classes
- AggregationFramework
- final class UnwindField extends (AggregationFramework.this)#Unwind
Turns a document with an array into multiple documents, one document for each element in the array.
Turns a document with an array into multiple documents, one document for each element in the array. http://docs.mongodb.org/manual/reference/aggregation/unwind/#_S_unwind
- Definition Classes
- AggregationFramework
- final class ChangeStream extends AggregationFramework.PipelineOperator
Low level pipeline operator which allows to open a tailable cursor against subsequent change events of a given collection.
Low level pipeline operator which allows to open a tailable cursor against subsequent change events of a given collection.
For common use-cases, you might prefer to use the
watch
operator on a collection.Note: the target mongo instance MUST be a replica-set (even in the case of a single node deployement).
- Definition Classes
- ChangeStreamAggregation
- Since
MongoDB 3.6
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final lazy val builder: Builder[pack.type]
- Attributes
- protected
- Definition Classes
- AggregationFramework
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val pack: GenericCollection.pack.type
The serialization pack (BSON by default).
The serialization pack (BSON by default).
Used to resolve the types of values (by default
BSONValue
,BSONDocument
, ...), and the related typeclasses (e.g.BSONDocumentReader
...).- Definition Classes
- AggregationFramework → PackSupport → AggregationPipeline
- final def pipe(name: String, arg: P.Value): P.Document
- Attributes
- protected
- Definition Classes
- AggregationFramework
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object AddFieldToSet
- Definition Classes
- GroupAggregation
- object AddToSet
- Definition Classes
- GroupAggregation
- object Ascending
- Definition Classes
- SortAggregation
- object AtlasSearch
EXPERIMENTAL: Atlas Search (only on MongoDB Atlas)
EXPERIMENTAL: Atlas Search (only on MongoDB Atlas)
- Definition Classes
- AtlasSearchAggregation
- object Avg
- Definition Classes
- GroupAggregation
- object AvgField
- Definition Classes
- GroupAggregation
- object Descending
- Definition Classes
- SortAggregation
- object First
- Definition Classes
- GroupAggregation
- object FirstField
- Definition Classes
- GroupAggregation
- object GroupFunction
Factory to declare custom call to a group function.
Factory to declare custom call to a group function.
- Definition Classes
- GroupAggregation
- object Last
- Definition Classes
- GroupAggregation
- object LastField
- Definition Classes
- GroupAggregation
- object Max
- Definition Classes
- GroupAggregation
- object MaxField
- Definition Classes
- GroupAggregation
- object MergeObjects
- Definition Classes
- GroupAggregation
- object MetadataSort
- Definition Classes
- SortAggregation
- object Min
- Definition Classes
- GroupAggregation
- object MinField
- Definition Classes
- GroupAggregation
- object PipelineOperator
Only for advanced user: Factory for stage not already provided in the API.
Only for advanced user: Factory for stage not already provided in the API.
For example for
{ $sample: { size: 2 } }
import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def foo(coll: BSONCollection) = coll.aggregateWith[BSONDocument]() { agg => import agg.PipelineOperator List(PipelineOperator(BSONDocument( f"$$sample" -> BSONDocument("size" -> 2)))) }
- Definition Classes
- AggregationPipeline
- object Push
- Definition Classes
- GroupAggregation
- object PushField
- Definition Classes
- GroupAggregation
- object SearchString
EXPERIMENTAL: Search string utilities
EXPERIMENTAL: Search string utilities
- Definition Classes
- AtlasSearchAggregation
- object Slice
import reactivemongo.api.bson.{ BSONDocument, BSONInteger, BSONString } import reactivemongo.api.bson.collection.BSONCollection def foo(coll: BSONCollection) = coll.aggregateWith[BSONDocument]() { agg => import agg.{ Project, Slice } // Define the pipeline stages List(Project(BSONDocument( "name" -> 1, "favorites" -> Slice( array = BSONString(f"$$favorites"), n = BSONInteger(3))))) }
- Definition Classes
- SliceAggregation
- object StdDevPop
- Definition Classes
- GroupAggregation
- object StdDevPopField
- Definition Classes
- GroupAggregation
- object StdDevSamp
- Definition Classes
- GroupAggregation
- object StdDevSampField
- Definition Classes
- GroupAggregation
- object Sum
- Definition Classes
- GroupAggregation
- case object SumAll extends commands.AggregationFramework.GroupFunction with Product with Serializable
The
$sum: 1
group accumulator.The
$sum: 1
group accumulator.- Definition Classes
- GroupAggregation
- object SumField
- Definition Classes
- GroupAggregation
- case object TextScore extends commands.AggregationFramework.MetadataKeyword with Product with Serializable
References the score associated with the corresponding
$text
query for each matching document.References the score associated with the corresponding
$text
query for each matching document.- Definition Classes
- SortAggregation
- object AddFields
$addFields stage .
$addFields stage .
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4
- object Bucket
$bucket aggregation stage .
$bucket aggregation stage .
- Definition Classes
- AggregationFramework
- object BucketAuto
$bucket aggregation stage .
$bucket aggregation stage .
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4 Categorizes incoming documents into a specific number of groups, called buckets, based on a specified expression. Bucket boundaries are automatically determined in an attempt to evenly distribute the documents into the specified number of buckets. Document fields identifier must be prefixed with
$
.
- object CollStats
$collStats aggregation stage .
$collStats aggregation stage .
- Definition Classes
- AggregationFramework
- object Count
$count of the number of documents input
$count of the number of documents input
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.4
- object CurrentOp
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.6
- object Facet
Performs $facet stage, to process multiple aggregation pipelines within a single stage on the same set of input documents.
Performs $facet stage, to process multiple aggregation pipelines within a single stage on the same set of input documents.
Each sub-pipeline has its own field in the output document where its results are stored as an array of documents.
- Definition Classes
- AggregationFramework
- object Filter
Filter companion
Filter companion
- Definition Classes
- AggregationFramework
- object GeoNear
- Definition Classes
- AggregationFramework
- object GraphLookup
- Definition Classes
- AggregationFramework
- object Group
$groups documents together to calculate aggregates on document collections .
$groups documents together to calculate aggregates on document collections .
This command aggregates on arbitrary identifiers. Document fields identifier must be prefixed with
$
.- Definition Classes
- AggregationFramework
- object GroupField
- Definition Classes
- AggregationFramework
- object GroupMulti
- Definition Classes
- AggregationFramework
- case object IndexStats extends (AggregationFramework.this)#PipelineOperator with Product with Serializable
$indexStats aggregation stage.
$indexStats aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.2
- object IndexStatsResult
- Definition Classes
- AggregationFramework
- object Limit
- Definition Classes
- AggregationFramework
- object ListLocalSessions
- Definition Classes
- AggregationFramework
- object ListSessions
- Definition Classes
- AggregationFramework
- object Lookup
Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing .
Performs a left outer join to an unsharded collection in the same database to filter in documents from the "joined" collection for processing .
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.2
- See also
- object LookupPipeline
Performs an uncorrelated lookup .
Performs an uncorrelated lookup .
- Definition Classes
- AggregationFramework
- Since
MongoDB 3.6
- See also
- object Match
Filters out documents from the stream that do not match the predicate.
Filters out documents from the stream that do not match the predicate.
- Definition Classes
- AggregationFramework
- object Merge
- Definition Classes
- AggregationFramework
- object Out
- Definition Classes
- AggregationFramework
- case object PlanCacheStats extends (AggregationFramework.this)#PipelineOperator with Product with Serializable
$planCacheStats aggregation stage.
$planCacheStats aggregation stage.
- Definition Classes
- AggregationFramework
- Since
MongoDB 4.2
- object Project
- Definition Classes
- AggregationFramework
- object Redact
- Definition Classes
- AggregationFramework
- object ReplaceRoot
- Definition Classes
- AggregationFramework
- object ReplaceRootField
- Definition Classes
- AggregationFramework
- object ReplaceWith
- Definition Classes
- AggregationFramework
- object Sample
- Definition Classes
- AggregationFramework
- object Set
- Definition Classes
- AggregationFramework
- object Skip
- Definition Classes
- AggregationFramework
- object Sort
- Definition Classes
- AggregationFramework
- object SortByCount
- Definition Classes
- AggregationFramework
- object SortByFieldCount
- Definition Classes
- AggregationFramework
- object Unset
- Definition Classes
- AggregationFramework
- object Unwind
- Definition Classes
- AggregationFramework
- object UnwindField
- Definition Classes
- AggregationFramework
- object ChangeStream
- Definition Classes
- ChangeStreamAggregation