AggregationFramework

reactivemongo.api.collections.AggregationOps.AggregationFramework$

The aggregation framework for this collection

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Inherited classlikes

final class AddFieldToSet extends GroupFunction

The $addToSet group accumulator.

The $addToSet group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class AddFields extends PipelineOperator

$addFields stage .

$addFields stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object AddFields

$addFields stage .

$addFields stage .

Attributes

Since:

MongoDB 3.4

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class AddToSet extends GroupFunction

The $addToSet group accumulator.

The $addToSet group accumulator.

Attributes

addToSetExpr

the $addToSet expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object AddToSet

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Ascending extends SortOrder

Ascending sort order

Ascending sort order

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
trait SortOrder
class Object
trait Matchable
class Any
object Ascending

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class AtlasSearch extends PipelineOperator

'''EXPERIMENTAL:''' See AtlasSearch$

'''EXPERIMENTAL:''' See AtlasSearch$

Attributes

index

the index name (optional)

Inherited from:
AtlasSearchAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

'''EXPERIMENTAL:''' Atlas Search (only on MongoDB Atlas)

'''EXPERIMENTAL:''' Atlas Search (only on MongoDB Atlas)

Attributes

Inherited from:
AtlasSearchAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Avg extends GroupFunction

The $avg group accumulator.

The $avg group accumulator.

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Avg

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class AvgField extends GroupFunction

The $avg group accumulator.

The $avg group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object AvgField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Bucket extends PipelineOperator

$bucket aggregation stage .

$bucket aggregation stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Bucket

$bucket aggregation stage .

$bucket aggregation stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class BucketAuto extends PipelineOperator

$bucket aggregation stage .

$bucket aggregation stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object BucketAuto

$bucket aggregation stage .

$bucket aggregation stage .

Attributes

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 $.

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class ChangeStream extends 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).

Attributes

Since:

MongoDB 3.6

Inherited from:
ChangeStreamAggregation
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
ChangeStreamAggregation
Graph
Supertypes
class Object
trait Matchable
class Any
final class CollStats extends PipelineOperator

$collStats aggregation stage .

$collStats aggregation stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object CollStats

$collStats aggregation stage .

$collStats aggregation stage .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Count extends PipelineOperator

$count of the number of documents input .

$count of the number of documents input .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Count

$count of the number of documents input

$count of the number of documents input

Attributes

Since:

MongoDB 3.4

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class CurrentOp extends PipelineOperator

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object CurrentOp

Attributes

Since:

MongoDB 3.6

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final protected class Cursor

Attributes

batchSize

the initial batch size for the cursor

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Descending extends SortOrder

Descending sort order

Descending sort order

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
trait SortOrder
class Object
trait Matchable
class Any
object Descending

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Documents extends PipelineOperator

$documents stage

$documents stage

Attributes

expression

the documents expression

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Documents

$documents stage

$documents stage

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Facet extends PipelineOperator

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
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.

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Filter

The $filter aggregation stage.

The $filter aggregation stage.

Attributes

as

The variable name for the element in the input array. The as expression accesses each element in the input array by this variable.

cond

the expression that determines whether to include the element in the resulting array

input

the expression that resolves to an array

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Filter

Filter companion

Filter companion

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class First extends GroupFunction

The $field group accumulator.

The $field group accumulator.

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object First

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class FirstField extends GroupFunction

The $field group accumulator.

The $field group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object FirstField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class GeoNear extends 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.

Attributes

distanceField

the output field that contains the calculated distance

distanceMultiplier

the factor to multiply all distances returned by the query

includeLocs

this specifies the output field that identifies the location used to calculate the distance

limit

the maximum number of documents to return (no longer supported since MongoDB 4.2)

maxDistance

the maximum distance from the center point that the documents can be

near

the point for which to find the closest documents

query

limits the results to the matching documents

spherical

if using a 2dsphere index

uniqueDocs

if this value is true, the query returns a matching document once

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object GeoNear

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class GraphLookup extends PipelineOperator

The $graphLookup aggregation stage.

The $graphLookup aggregation stage.

Attributes

as

the name of the array field added to each output document

connectFromField

the field name whose value $graphLookup uses to recursively match against the connectToField of other documents in the collection

connectToField

the field name in other documents against which to match the value of the field specified by the connectFromField parameter

depthField

an optional name for a field to add to each traversed document in the search path

from

the target collection for the $graphLookup operation to search

maxDepth

an optional non-negative integral number specifying the maximum recursion depth

restrictSearchWithMatch

an optional filter expression

startWith

the expression that specifies the value of the connectFromField with which to start the recursive search

Since:

MongoDB 3.4

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Group extends PipelineOperator

$groups documents together to calculate aggregates on document collections .

$groups documents together to calculate aggregates on document collections .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
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 $.

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class GroupField extends PipelineOperator

$groups documents together to calculate aggregates on document collections. This command aggregates on one field.

$groups documents together to calculate aggregates on document collections. This command aggregates on one field.

Attributes

idField

the name of the field to aggregate on

ops

the sequence of operators specifying aggregate calculation

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object GroupField

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Factory to declare custom call to a group function.

Factory to declare custom call to a group function.

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
sealed trait GroupFunction

Represents one of the group/accumulator operators, for the $group aggregation. Operation.

Represents one of the group/accumulator operators, for the $group aggregation. Operation.

Attributes

See also:
Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AddToSet
class Avg
class AvgField
class First
class Last
class LastField
class Max
class MaxField
class Min
class MinField
class Push
class PushField
class StdDevPop
class Sum
object SumAll.type
class SumField
class SumValue
final class GroupMulti extends PipelineOperator

$groups documents together to calculate aggregates on document collections. This command aggregates on multiple fields, and they must be named.

$groups documents together to calculate aggregates on document collections. This command aggregates on multiple fields, and they must be named.

Attributes

idFields

The fields to aggregate on, and the names they should be aggregated under.

ops

the sequence of operators specifying aggregate calculation

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object GroupMulti

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class IndexStatAccesses

Attributes

ops

the number of operations that used the index

since

the time from which MongoDB gathered the statistics

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
case object IndexStats extends PipelineOperator

$indexStats aggregation stage.

$indexStats aggregation stage.

Attributes

Since:

MongoDB 3.2

Inherited from:
AggregationFramework
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
final class IndexStatsResult

Attributes

accesses

the index statistics

host

the hostname and port of the mongod

key

the key specification

name

the index name

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Last extends GroupFunction

The $field group accumulator.

The $field group accumulator.

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Last

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class LastField extends GroupFunction

The $field group accumulator.

The $field group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object LastField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Limit extends PipelineOperator

$limits the number of documents that pass through the stream.

$limits the number of documents that pass through the stream.

Attributes

limit

the number of documents to allow through

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Limit

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

$listLocalSessions aggregation stage.

$listLocalSessions aggregation stage.

Attributes

Since:

MongoDB 3.6

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class ListSessions(val expression: Document) extends PipelineOperator

$listSessions aggregation stage.

$listSessions aggregation stage.

Attributes

Since:

MongoDB 3.6

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Lookup extends 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 .

Attributes

See also:
Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
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 .

Attributes

See also:
Since:

MongoDB 3.2

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class LookupPipeline extends PipelineOperator

Performs an uncorrelated lookup .

Performs an uncorrelated lookup .

Attributes

See also:
Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Performs an uncorrelated lookup .

Performs an uncorrelated lookup .

Attributes

See also:
Since:

MongoDB 3.6

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Match extends 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 .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
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 .

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Max extends GroupFunction

The $max group accumulator.

The $max group accumulator.

Attributes

maxExpr

the $max expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Max

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class MaxField extends GroupFunction

The $max group accumulator.

The $max group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object MaxField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Merge extends PipelineOperator

$merge aggregation stage.

$merge aggregation stage.

Attributes

Since:

MongoDB 4.2

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Merge

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class MergeObjects extends GroupFunction

The $mergeObjects group accumulator.

The $mergeObjects group accumulator.

Attributes

mergeExpr

the $mergeObjects expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
sealed trait MetadataKeyword

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TextScore.type
final class MetadataSort extends SortOrder

Attributes

keyword

the metadata keyword to sort by

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
trait SortOrder
class Object
trait Matchable
class Any

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Min(val expression: Value) extends GroupFunction

The $min group accumulator.

The $min group accumulator.

Attributes

minExpr

the $min expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Min

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class MinField extends GroupFunction

The $min group accumulator.

The $min group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object MinField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Out extends 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

Attributes

collection

the name of the output collection

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Out

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

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))))
 }

Attributes

Inherited from:
AggregationPipeline (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

One of MongoDBs pipeline operators for aggregation. Sealed as these are defined in the MongoDB specifications, and clients should not have custom operators.

One of MongoDBs pipeline operators for aggregation. Sealed as these are defined in the MongoDB specifications, and clients should not have custom operators.

Attributes

Inherited from:
AggregationPipeline (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AddFields
class Bucket
class CollStats
class Count
class CurrentOp
class Documents
class Facet
class GeoNear
class Group
object IndexStats.type
class Limit
class Lookup
class Match
class Merge
class Out
object PlanCacheStats.type
class Project
class Redact
class Sample
class Set
class Skip
class Slice
class Sort
class UnionWith
class Unset
trait Unwind
case object PlanCacheStats extends PipelineOperator

$planCacheStats aggregation stage.

$planCacheStats aggregation stage.

Attributes

Since:

MongoDB 4.2

Inherited from:
AggregationFramework
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
final class Project extends PipelineOperator

Reshapes a document stream by renaming, adding, or removing fields. Also uses Project to create computed values or sub-objects.

Reshapes a document stream by renaming, adding, or removing fields. Also uses Project to create computed values or sub-objects.

Attributes

specifications

The fields to include. The resulting objects will contain only these fields.

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Project

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Push extends GroupFunction

The $push group accumulator.

The $push group accumulator.

Attributes

pushExpr

the $push expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Push

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class PushField extends GroupFunction

The $push group accumulator.

The $push group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object PushField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Redact extends PipelineOperator

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

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

Attributes

expression

the redact expression

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Redact

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class ReplaceRoot extends PipelineOperator

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

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

Attributes

newRoot

The new root object

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

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

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

Attributes

newRoot

The field name to become the new root

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class ReplaceWith extends PipelineOperator

The $replaceWith aggregation stage.

The $replaceWith aggregation stage.

Attributes

Since:

MongoDB 4.2

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Sample extends 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.

Attributes

size

the number of documents to return

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Sample

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class SearchString

'''EXPERIMENTAL:''' One or at least one string with optional alternate analyzer specified in multi field

'''EXPERIMENTAL:''' One or at least one string with optional alternate analyzer specified in multi field

Attributes

Inherited from:
AtlasSearchAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

'''EXPERIMENTAL:''' Search string utilities

'''EXPERIMENTAL:''' Search string utilities

Attributes

See also:
Inherited from:
AtlasSearchAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Set extends PipelineOperator

$set aggregation stage

$set aggregation stage

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Set

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Skip extends 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.

Attributes

skip

the number of documents to skip

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Skip

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Slice extends PipelineOperator

Returns a slice/subset of an array.

Returns a slice/subset of an array.

Attributes

array

any valid expression that resolves to an array

n

any valud expression that resolves to an integer

position

any valid expression that resolves to an integer

Inherited from:
SliceAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
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)))))
 }

Attributes

Inherited from:
SliceAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Sort extends PipelineOperator

$sorts the stream based on the given fields.

$sorts the stream based on the given fields.

Attributes

fields

the fields to sort by

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Sort

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class SortByCount extends PipelineOperator

The $sortByCount aggregation stage.

The $sortByCount aggregation stage.

Attributes

Since:

MongoDB 3.4

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

The $sortByCount aggregation stage.

The $sortByCount aggregation stage.

Attributes

field

the field name

Since:

MongoDB 3.4

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
sealed trait SortOrder

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.

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class StdDevPop extends GroupFunction

The $stdDevPop group accumulator.

The $stdDevPop group accumulator.

Attributes

Since:

MongoDB 3.2

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object StdDevPop

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class StdDevPopField extends GroupFunction

The $stdDevPop for a single field.

The $stdDevPop for a single field.

Attributes

field

the name of field to group

Since:

MongoDB 3.2

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class StdDevSamp extends GroupFunction

The $stdDevSamp group accumulator

The $stdDevSamp group accumulator

Attributes

Since:

MongoDB 3.2

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object StdDevSamp

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class StdDevSampField extends GroupFunction

The $stdDevSamp for a single field

The $stdDevSamp for a single field

Attributes

field

the name of field to group

Since:

MongoDB 3.2

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class Sum extends GroupFunction

The $sum group accumulator.

The $sum group accumulator.

Attributes

sumExpr

the $sum expression

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object Sum

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
case object SumAll extends GroupFunction

The `$sum: 1` group accumulator.

The `$sum: 1` group accumulator.

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
final class SumField extends GroupFunction

The $sum group accumulator.

The $sum group accumulator.

Attributes

field

the name of field to group

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
object SumField

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
final class SumValue(val value: Int) extends GroupFunction

Attributes

Inherited from:
GroupAggregation (hidden)
Graph
Supertypes
class Object
trait Matchable
class Any
case object TextScore extends MetadataKeyword

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.

Attributes

Inherited from:
SortAggregation (hidden)
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
final class UnionWith extends PipelineOperator

$unionWith stage

$unionWith stage

Attributes

collection

the name of the collection

pipeline

the union pipeline

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object UnionWith

$unionWith stage

$unionWith stage

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
final class Unset extends PipelineOperator

The $unset aggregation stage.

The $unset aggregation stage.

Attributes

field

the field name

Since:

MongoDB 4.2

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Unset

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
object Unwind

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
sealed trait Unwind extends PipelineOperator

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class UnwindField extends Unwind

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

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

Attributes

field

the name of the array to unwind

Inherited from:
AggregationFramework
Graph
Supertypes
trait Unwind
class Object
trait Matchable
class Any

Attributes

Inherited from:
AggregationFramework
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited types

Aggregation pipeline (with at least one stage operator)

Aggregation pipeline (with at least one stage operator)

Attributes

Inherited from:
AggregationPipeline (hidden)

Value members

Inherited methods

final protected def pipe(name: String, arg: Value): Document

Attributes

Inherited from:
AggregationFramework

Concrete fields

val pack: P

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 ...).

Attributes

Inherited fields

final lazy protected val builder: Builder[P]

Attributes

Inherited from:
AggregationFramework