Trait

reactivemongo.api.commands

AggregationFramework

Related Doc: package commands

Permalink

trait AggregationFramework[P <: SerializationPack] extends ImplicitCommandHelpers[P]

Implements the Aggregation Framework.

Linear Supertypes
ImplicitCommandHelpers[P], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AggregationFramework
  2. ImplicitCommandHelpers
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class AddToSet(field: String) extends GroupFunction with Product with Serializable

    Permalink
  2. case class Aggregate(pipeline: Seq[PipelineOperator], explain: Boolean = false, allowDiskUse: Boolean, cursor: Option[Cursor], wireVersion: MongoWireVersion, bypassDocumentValidation: Boolean, readConcern: Option[ReadConcern]) extends CollectionCommand with CommandWithPack[pack.type] with CommandWithResult[AggregationResult] with Product with Serializable

    Permalink

    pipeline

    the sequence of MongoDB aggregation operations

    explain

    specifies to return the information on the processing of the pipeline

    allowDiskUse

    enables writing to temporary files

    cursor

    the cursor object for aggregation

    bypassDocumentValidation

    available only if you specify the $out aggregation operator

    readConcern

    the read concern (since MongoDB 3.2)

  3. case class AggregationResult(firstBatch: List[P.Document], cursor: Option[ResultCursor] = None) extends Product with Serializable

    Permalink

    firstBatch

    the documents of the first batch

    cursor

    the cursor from the result, if any

    See also

    Cursor

  4. case class Ascending(field: String) extends SortOrder with Product with Serializable

    Permalink

    Ascending sort order

  5. case class Avg(field: String) extends GroupFunction with Product with Serializable

    Permalink
  6. case class Cursor(batchSize: Int) extends Product with Serializable

    Permalink

    batchSize

    the initial batch size for the cursor

  7. case class Descending(field: String) extends SortOrder with Product with Serializable

    Permalink

    Descending sort order

  8. case class First(field: String) extends GroupFunction with Product with Serializable

    Permalink
  9. case class GeoNear(spherical: Boolean = false, limit: Long = 100, maxDistance: Option[Long] = None, selector: Option[P.Document] = None, distanceMultiplier: Option[Double] = None, uniqueDocs: Boolean = false, near: Option[P.Value] = None, distanceField: Option[String] = None, includeLocs: Option[String] = None) extends PipelineOperator with Product with Serializable

    Permalink

    Outputs documents in order of nearest to farthest from a specified point.

    Outputs documents in order of nearest to farthest from a specified point. http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/#pipe._S_geoNear

    spherical

    if using a 2dsphere index

    limit

    the maximum number of documents to return

    maxDistance

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

    selector

    limits the results to the matching documents

    distanceMultiplier

    the factor to multiply all distances returned by the query

    uniqueDocs

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

    near

    the point for which to find the closest documents

    distanceField

    the output field that contains the calculated distance

    includeLocs

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

  10. case class Group(identifiers: P.Value)(ops: (String, GroupFunction)*) extends PipelineOperator with Product with Serializable

    Permalink

    Groups documents together to calulate aggregates on document collections.

    Groups documents together to calulate aggregates on document collections. This command aggregates on arbitrary identifiers. Document fields identifier must be prefixed with $. http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group

    identifiers

    any BSON value acceptable by mongodb as identifier

    ops

    the sequence of operators specifying aggregate calculation

  11. case class GroupField(idField: String)(ops: (String, GroupFunction)*) extends PipelineOperator with Product with Serializable

    Permalink

    Groups documents together to calulate aggregates on document collections.

    Groups documents together to calulate aggregates on document collections. This command aggregates on one field. http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group

    idField

    the name of the field to aggregate on

    ops

    the sequence of operators specifying aggregate calculation

  12. sealed trait GroupFunction extends AnyRef

    Permalink

    Represents one of the group operators for the "Group" Operation.

    Represents one of the group operators for the "Group" Operation. This class is sealed as these are defined in the MongoDB spec, and clients should not need to customise these.

  13. case class GroupMulti(idFields: (String, String)*)(ops: (String, GroupFunction)*) extends PipelineOperator with Product with Serializable

    Permalink

    Groups documents together to calulate aggregates on document collections.

    Groups documents together to calulate aggregates on document collections. This command aggregates on multiple fields, and they must be named. http://docs.mongodb.org/manual/reference/aggregation/group/#_S_group

    idFields

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

    ops

    the sequence of operators specifying aggregate calculation

  14. trait ImplicitlyDocumentProducer extends AnyRef

    Permalink
    Definition Classes
    ImplicitCommandHelpers
  15. case class Last(field: String) extends GroupFunction with Product with Serializable

    Permalink
  16. case class Limit(limit: Int) extends PipelineOperator with Product with Serializable

    Permalink

    Limits the number of documents that pass through the stream.

    Limits the number of documents that pass through the stream. http://docs.mongodb.org/manual/reference/aggregation/limit/#_S_limit

    limit

    the number of documents to allow through

  17. case class Match(predicate: P.Document) extends PipelineOperator with Product with Serializable

    Permalink

    Filters out documents from the stream that do not match the predicate.

    Filters out documents from the stream that do not match the predicate. http://docs.mongodb.org/manual/reference/aggregation/match/#_S_match

    predicate

    the query that documents must satisfy to be in the stream

  18. case class Max(field: String) extends GroupFunction with Product with Serializable

    Permalink
  19. sealed trait MetadataKeyword extends AnyRef

    Permalink

    Keyword of metadata.

  20. case class MetadataSort(field: String, keyword: MetadataKeyword) extends SortOrder with Product with Serializable

    Permalink

    Metadata sort order.

    keyword

    the metadata keyword to sort by

  21. case class Min(field: String) extends GroupFunction with Product with Serializable

    Permalink
  22. case class Out(collection: String) extends PipelineOperator with Product with Serializable

    Permalink

    Takes the documents returned by the aggregation pipeline and writes them to a specified collection http://docs.mongodb.org/manual/reference/operator/aggregation/out/#pipe._S_out

    Takes the documents returned by the aggregation pipeline and writes them to a specified collection http://docs.mongodb.org/manual/reference/operator/aggregation/out/#pipe._S_out

    collection

    the name of the output collection

  23. sealed trait PipelineOperator extends AnyRef

    Permalink

    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.

  24. case class Project(specifications: P.Document) extends PipelineOperator with Product with Serializable

    Permalink

    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.

    specifications

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

  25. case class Push(field: String) extends GroupFunction with Product with Serializable

    Permalink
  26. case class PushMulti(fields: (String, String)*) extends GroupFunction with Product with Serializable

    Permalink
  27. case class Redact(expression: P.Document) extends PipelineOperator with Product with Serializable

    Permalink

    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

    expression

    the redact expression

  28. case class Sample(size: Int) extends PipelineOperator with Product with Serializable

    Permalink

    Randomly selects the specified number of documents from its input.

    Randomly selects the specified number of documents from its input. https://docs.mongodb.org/master/reference/operator/aggregation/sample/

    size

    the number of documents to return

  29. case class Skip(skip: Int) extends PipelineOperator with Product with Serializable

    Permalink

    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. http://docs.mongodb.org/manual/reference/aggregation/skip/#_S_skip

    skip

    the number of documents to skip

  30. case class Sort(fields: SortOrder*) extends PipelineOperator with Product with Serializable

    Permalink

    Sorts the stream based on the given fields.

    Sorts the stream based on the given fields. http://docs.mongodb.org/manual/reference/aggregation/sort/#_S_sort

    fields

    the fields to sort by

  31. sealed trait SortOrder extends AnyRef

    Permalink

    Represents that a field should be sorted on, as well as whether it should be ascending or descending.

  32. case class SumField(field: String) extends GroupFunction with Product with Serializable

    Permalink
  33. case class SumValue(value: Int) extends GroupFunction with Product with Serializable

    Permalink
  34. case class Unwind(field: String) extends PipelineOperator with Product with Serializable

    Permalink

    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

    field

    the name of the array to unwind

Abstract Value Members

  1. abstract def booleanValue(b: Boolean): P.Value

    Permalink

    Returns an boolean as a serialized value.

    Returns an boolean as a serialized value.

    Attributes
    protected
  2. abstract def doubleValue(d: Double): P.Value

    Permalink

    Returns an double as a serialized value.

    Returns an double as a serialized value.

    Attributes
    protected
  3. abstract def elementProducer(name: String, value: P.Value): P.ElementProducer

    Permalink

    Returns a producer of element for the given name and value.

    Returns a producer of element for the given name and value.

    name

    the element name

    value

    the element value

    Attributes
    protected
  4. abstract def intValue(i: Int): P.Value

    Permalink

    Returns an integer as a serialized value.

    Returns an integer as a serialized value.

    Attributes
    protected
  5. abstract def longValue(l: Long): P.Value

    Permalink

    Returns an long as a serialized value.

    Returns an long as a serialized value.

    Attributes
    protected
  6. abstract def makeDocument(elements: Seq[P.ElementProducer]): P.Document

    Permalink

    Returns a document from a sequence of element producers.

    Returns a document from a sequence of element producers.

    Attributes
    protected
  7. abstract val pack: P

    Permalink
    Definition Classes
    ImplicitCommandHelpers
  8. abstract def stringValue(s: String): P.Value

    Permalink

    Returns an string as a serialized value.

    Returns an string as a serialized value.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to any2stringadd[AggregationFramework[P]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (AggregationFramework[P], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to ArrowAssoc[AggregationFramework[P]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. object GroupFunction

    Permalink

    Factory to declare custom call to a group function.

  7. object ImplicitlyDocumentProducer

    Permalink
    Definition Classes
    ImplicitCommandHelpers
  8. object TextScore extends MetadataKeyword with Product with Serializable

    Permalink

    References the score associated with the corresponding $text query for each matching document.

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def ensuring(cond: (AggregationFramework[P]) ⇒ Boolean, msg: ⇒ Any): AggregationFramework[P]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to Ensuring[AggregationFramework[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (AggregationFramework[P]) ⇒ Boolean): AggregationFramework[P]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to Ensuring[AggregationFramework[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): AggregationFramework[P]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to Ensuring[AggregationFramework[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): AggregationFramework[P]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to Ensuring[AggregationFramework[P]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to StringFormat[AggregationFramework[P]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def [B](y: B): (AggregationFramework[P], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AggregationFramework[P] to ArrowAssoc[AggregationFramework[P]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from ImplicitCommandHelpers[P]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AggregationFramework[P] to any2stringadd[AggregationFramework[P]]

Inherited by implicit conversion StringFormat from AggregationFramework[P] to StringFormat[AggregationFramework[P]]

Inherited by implicit conversion Ensuring from AggregationFramework[P] to Ensuring[AggregationFramework[P]]

Inherited by implicit conversion ArrowAssoc from AggregationFramework[P] to ArrowAssoc[AggregationFramework[P]]

Ungrouped