Packages

object Aggregates

Builders for aggregation pipeline stages.

Since

1.0

See also

Aggregation pipeline

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Aggregates
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addFields(fields: Field[_]*): Bson

    Creates an $addFields pipeline stage

    Creates an $addFields pipeline stage

    fields

    the fields to add

    returns

    the $addFields pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $addFields

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def bucket[TExpression, TBoundary](groupBy: TExpression, options: BucketOptions, boundaries: TBoundary*): Bson

    Creates a $bucket pipeline stage

    Creates a $bucket pipeline stage

    TExpression

    the groupBy expression type

    TBoundary

    the boundary type

    groupBy

    the criteria to group By

    options

    the optional values for the $bucket stage

    boundaries

    the boundaries of the buckets

    returns

    the $bucket pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $bucket

  7. def bucket[TExpression, TBoundary](groupBy: TExpression, boundaries: TBoundary*): Bson

    Creates a $bucket pipeline stage

    Creates a $bucket pipeline stage

    TExpression

    the groupBy expression type

    TBoundary

    the boundary type

    groupBy

    the criteria to group By

    boundaries

    the boundaries of the buckets

    returns

    the $bucket pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $bucket

  8. def bucketAuto[TExpression, TBoundary](groupBy: TExpression, buckets: Int, options: BucketAutoOptions): Bson

    Creates a $bucketAuto pipeline stage

    Creates a $bucketAuto pipeline stage

    TExpression

    the groupBy expression type

    groupBy

    the criteria to group By

    buckets

    the number of the buckets

    options

    the optional values for the $bucketAuto stage

    returns

    the $bucketAuto pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $bucketAuto

  9. def bucketAuto[TExpression, TBoundary](groupBy: TExpression, buckets: Int): Bson

    Creates a $bucketAuto pipeline stage

    Creates a $bucketAuto pipeline stage

    TExpression

    the groupBy expression type

    groupBy

    the criteria to group By

    buckets

    the number of the buckets

    returns

    the $bucketAuto pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $bucketAuto

  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  11. def count(field: String): Bson

    Creates a $count pipeline stage using the named field to store the result

    Creates a $count pipeline stage using the named field to store the result

    field

    the field in which to store the count

    returns

    the $count pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $count

  12. def count(): Bson

    Creates a $count pipeline stage using the field name "count" to store the result

    Creates a $count pipeline stage using the field name "count" to store the result

    returns

    the $count pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $count

  13. def densify(field: String, range: DensifyRange, options: DensifyOptions): Bson

    Creates a $densify pipeline stage, which adds documents to a sequence of documents where certain values in the field are missing.

    Creates a $densify pipeline stage, which adds documents to a sequence of documents where certain values in the field are missing.

    field

    The field to densify.

    range

    The range.

    options

    The densify options. Specifying DensifyOptions.densifyOptions is equivalent to calling Aggregates.densify(String, DensifyRange).

    returns

    The requested pipeline stage.

    Since

    4.7

    Note

    Requires MongoDB 5.1 or greater.

    See also

    $densify

    Dot notation

  14. def densify(field: String, range: DensifyRange): Bson

    Creates a $densify pipeline stage, which adds documents to a sequence of documents where certain values in the field are missing.

    Creates a $densify pipeline stage, which adds documents to a sequence of documents where certain values in the field are missing.

    field

    The field to densify.

    range

    The range.

    returns

    The requested pipeline stage.

    Since

    4.7

    Note

    Requires MongoDB 5.1 or greater.

    See also

    $densify

    Dot notation

  15. def documents(documents: Bson*): Bson

    Creates a $documents pipeline stage.

    Creates a $documents pipeline stage.

    documents

    the documents.

    returns

    the $documents pipeline stage

    Since

    4.9

    See also

    $documents

  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. def facet(facets: Facet*): Bson

    Creates a $facet pipeline stage

    Creates a $facet pipeline stage

    facets

    the facets to use

    returns

    the new pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $facet

  19. def fill(options: FillOptions, output: Iterable[_ <: FillOutputField]): Bson

    Creates a $fill pipeline stage, which assigns values to fields when they are BSON Null or missing.

    Creates a $fill pipeline stage, which assigns values to fields when they are BSON Null or missing.

    options

    The fill options.

    output

    The non-empty FillOutputFields.

    returns

    The requested pipeline stage.

    Since

    4.7

    Note

    Requires MongoDB 5.3 or greater.

    See also

    $fill

  20. def fill(options: FillOptions, output: FillOutputField, moreOutput: FillOutputField*): Bson

    Creates a $fill pipeline stage, which assigns values to fields when they are BSON Null or missing.

    Creates a $fill pipeline stage, which assigns values to fields when they are BSON Null or missing.

    options

    The fill options.

    output

    The FillOutputField.

    moreOutput

    More FillOutputFields.

    returns

    The requested pipeline stage.

    Since

    4.7

    Note

    Requires MongoDB 5.3 or greater.

    See also

    $fill

  21. def filter(filter: Bson): Bson

    Creates a $match pipeline stage for the specified filter

    Creates a $match pipeline stage for the specified filter

    A friendly alias for the match method.

    filter

    the filter to match against

    returns

    the $match pipeline stage

    See also

    Filters

    $match

  22. def geoNear(near: Point, distanceField: String): Bson

    Creates a $geoNear pipeline stage that outputs documents in order of nearest to farthest from a specified point.

    Creates a $geoNear pipeline stage that outputs documents in order of nearest to farthest from a specified point.

    near

    The point for which to find the closest documents.

    distanceField

    The output field that contains the calculated distance. To specify a field within an embedded document, use dot notation.

    returns

    the $geoNear pipeline stage

    Since

    4.8

    See also

    $geoNear

  23. def geoNear(near: Point, distanceField: String, options: GeoNearOptions): Bson

    Creates a $geoNear pipeline stage that outputs documents in order of nearest to farthest from a specified point.

    Creates a $geoNear pipeline stage that outputs documents in order of nearest to farthest from a specified point.

    near

    The point for which to find the closest documents.

    distanceField

    The output field that contains the calculated distance. To specify a field within an embedded document, use dot notation.

    options

    GeoNearOptions

    returns

    the $geoNear pipeline stage

    Since

    4.8

    See also

    $geoNear

  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  25. def graphLookup[TExpression](from: String, startWith: TExpression, connectFromField: String, connectToField: String, as: String, options: GraphLookupOptions): Bson

    Creates a graphLookup pipeline stage for the specified filter

    Creates a graphLookup pipeline stage for the specified filter

    TExpression

    the expression type

    from

    the collection to query

    startWith

    the expression to start the graph lookup with

    connectFromField

    the from field

    connectToField

    the to field

    as

    name of field in output document

    options

    optional values for the graphLookup

    returns

    the $graphLookup pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $graphLookup

  26. def graphLookup[TExpression](from: String, startWith: TExpression, connectFromField: String, connectToField: String, as: String): Bson

    Creates a $graphLookup pipeline stage for the specified filter

    Creates a $graphLookup pipeline stage for the specified filter

    TExpression

    the expression type

    from

    the collection to query

    startWith

    the expression to start the graph lookup with

    connectFromField

    the from field

    connectToField

    the to field

    as

    name of field in output document

    returns

    the $graphLookup pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $graphLookup

  27. def group[TExpression](id: TExpression, fieldAccumulators: BsonField*): Bson

    Creates a $group pipeline stage for the specified filter

    Creates a $group pipeline stage for the specified filter

    TExpression

    the expression type

    id

    the id expression for the group

    fieldAccumulators

    zero or more field accumulator pairs

    returns

    the $group pipeline stage

    See also

    $group

    Expressions

  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def limit(limit: Int): Bson

    Creates a $limit pipeline stage for the specified filter

    Creates a $limit pipeline stage for the specified filter

    limit

    the limit

    returns

    the $limit pipeline stage

    See also

    $limit

  31. def lookup[T](from: String, let: Seq[Variable[T]], pipeline: Seq[_ <: Bson], as: String): Bson

    Creates a $lookup pipeline stage, joining the current collection with the one specified in from using the given pipeline.

    Creates a $lookup pipeline stage, joining the current collection with the one specified in from using the given pipeline. If the first stage in the pipeline is a $documents stage, then the "from" collection is ignored.

    from

    the name of the collection in the same database to perform the join with. May be null if the first pipeline stage is $documents.

    let

    the variables to use in the pipeline field stages.

    pipeline

    the pipeline to run on the joined collection.

    as

    the name of the new array field to add to the input documents.

    returns

    the $lookup pipeline stage

    Since

    2.3

    Note

    Requires MongoDB 3.6 or greater

    See also

    $lookup

  32. def lookup(from: String, pipeline: Seq[_ <: Bson], as: String): Bson

    Creates a $lookup pipeline stage, joining the current collection with the one specified in from using the given pipeline.

    Creates a $lookup pipeline stage, joining the current collection with the one specified in from using the given pipeline. If the first stage in the pipeline is a $documents stage, then the "from" collection is ignored.

    from

    the name of the collection in the same database to perform the join with. May be null if the first pipeline stage is $documents.

    pipeline

    the pipeline to run on the joined collection.

    as

    the name of the new array field to add to the input documents.

    returns

    the $lookup pipeline stage:

    Since

    2.3

    Note

    Requires MongoDB 3.6 or greater

    See also

    $lookup

  33. def lookup(from: String, localField: String, foreignField: String, as: String): Bson

    Creates a $lookup pipeline stage for the specified filter

    Creates a $lookup pipeline stage for the specified filter

    from

    the name of the collection in the same database to perform the join with.

    localField

    specifies the field from the local collection to match values against.

    foreignField

    specifies the field in the from collection to match values against.

    as

    the name of the new array field to add to the input documents.

    returns

    the $lookup pipeline stage

    Since

    1.1

    Note

    Requires MongoDB 3.2 or greater

    See also

    $lookup

  34. def match(filter: Bson): Bson

    Creates a $match pipeline stage for the specified filter

    Creates a $match pipeline stage for the specified filter

    filter

    the filter to match

    returns

    the $match pipeline stage

    See also

    Filters

    $match

  35. def merge(namespace: MongoNamespace, mergeOptions: MergeOptions): Bson

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    namespace

    the namespace to merge into

    mergeOptions

    the mergeOptions

    returns

    the $merge pipeline stage

    Since

    2.7

    See also

    https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/

  36. def merge(namespace: MongoNamespace): Bson

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    namespace

    the namespace to merge into

    returns

    the $merge pipeline stage

    Since

    2.7

    See also

    https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/

  37. def merge(collectionName: String, mergeOptions: MergeOptions): Bson

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    collectionName

    the name of the collection to merge into

    mergeOptions

    the mergeOptions

    returns

    the $merge pipeline stage

    Since

    2.7

    See also

    https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/

  38. def merge(collectionName: String): Bson

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    Creates a $merge pipeline stage that merges into the specified collection using the specified options.

    collectionName

    the name of the collection to merge into

    returns

    the $merge pipeline stage

    Since

    2.7

    See also

    https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/

  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  42. def out(databaseName: String, collectionName: String): Bson

    Creates a $out pipeline stage that supports outputting to a different database.

    Creates a $out pipeline stage that supports outputting to a different database.

    databaseName

    the database name

    collectionName

    the collection name

    returns

    the $out pipeline stage

    See also

    $out

  43. def out(collectionName: String): Bson

    Creates a $out pipeline stage that writes to the collection with the specified name

    Creates a $out pipeline stage that writes to the collection with the specified name

    collectionName

    the collection name

    returns

    the $out pipeline stage

    See also

    $out

  44. def project(projection: Bson): Bson

    Creates a $project pipeline stage for the specified projection

    Creates a $project pipeline stage for the specified projection

    projection

    the projection

    returns

    the $project pipeline stage

    See also

    Projections

    $project

  45. def replaceRoot[TExpression](value: TExpression): Bson

    Creates a $replaceRoot pipeline stage

    Creates a $replaceRoot pipeline stage

    TExpression

    the new root type

    value

    the new root value

    returns

    the $replaceRoot pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    $replaceRoot

  46. def replaceWith[TExpression](value: TExpression): Bson

    Creates a $replaceRoot pipeline stage

    Creates a $replaceRoot pipeline stage

    With $replaceWith, you can promote an embedded document to the top-level. You can also specify a new document as the replacement.

    The $replaceWith is an alias for replaceRoot.

    TExpression

    the new root type

    value

    the new root value

    returns

    the $replaceRoot pipeline stage

    Since

    2.7

    See also

    $replaceWith

  47. def sample(size: Int): Bson

    Creates a $sample pipeline stage with the specified sample size

    Creates a $sample pipeline stage with the specified sample size

    size

    the sample size

    returns

    the $sample pipeline stage

    Since

    1.1

    See also

    $sample

  48. def search(collector: SearchCollector, options: SearchOptions): Bson

    Creates a $search pipeline stage supported by MongoDB Atlas.

    Creates a $search pipeline stage supported by MongoDB Atlas. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Filters.text(String, TextSearchOptions) is a legacy text search alternative.

    collector

    A search collector.

    options

    Optional $search pipeline stage fields. Specifying SearchOptions.searchOptions is equivalent to calling Aggregates.search(SearchCollector).

    returns

    The $search pipeline stage.

    Since

    4.7

    See also

    $search

    Search collectors

    Scoring

  49. def search(collector: SearchCollector): Bson

    Creates a $search pipeline stage supported by MongoDB Atlas.

    Creates a $search pipeline stage supported by MongoDB Atlas. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Filters.text(String, TextSearchOptions) is a legacy text search alternative.

    collector

    A search collector.

    returns

    The $search pipeline stage.

    Since

    4.7

    See also

    $search

    Search collectors

    Scoring

  50. def search(operator: SearchOperator, options: SearchOptions): Bson

    Creates a $search pipeline stage supported by MongoDB Atlas.

    Creates a $search pipeline stage supported by MongoDB Atlas. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Filters.text(String, TextSearchOptions) is a legacy text search alternative.

    operator

    A search operator.

    options

    Optional $search pipeline stage fields. Specifying SearchOptions.searchOptions is equivalent to calling Aggregates.search(SearchOperator).

    returns

    The $search pipeline stage.

    Since

    4.7

    See also

    $search

    Search operators

    Scoring

  51. def search(operator: SearchOperator): Bson

    Creates a $search pipeline stage supported by MongoDB Atlas.

    Creates a $search pipeline stage supported by MongoDB Atlas. You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore, to extract the relevance score assigned to each found document.

    Filters.text(String, TextSearchOptions) is a legacy text search alternative.

    operator

    A search operator.

    returns

    The $search pipeline stage.

    Since

    4.7

    See also

    $search

    Search operators

    Scoring

  52. def searchMeta(collector: SearchCollector, options: SearchOptions): Bson

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas.

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas. Unlike $search, it does not return found documents, instead it returns metadata, which in case of using the $search stage may be extracted by using $$SEARCH_META variable, e.g., via Projections.computedSearchMeta.

    collector

    A search collector.

    options

    Optional $search pipeline stage fields. Specifying SearchOptions.searchOptions is equivalent to calling Aggregates.searchMeta(SearchCollector).

    returns

    The $searchMeta pipeline stage.

    Since

    4.7

    See also

    $searchMeta

    Search collectors

  53. def searchMeta(collector: SearchCollector): Bson

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas.

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas. Unlike $search, it does not return found documents, instead it returns metadata, which in case of using the $search stage may be extracted by using $$SEARCH_META variable, e.g., via Projections.computedSearchMeta.

    collector

    A search collector.

    returns

    The $searchMeta pipeline stage.

    Since

    4.7

    See also

    $searchMeta

    Search collectors

  54. def searchMeta(operator: SearchOperator, options: SearchOptions): Bson

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas.

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas. Unlike $search, it does not return found documents, instead it returns metadata, which in case of using the $search stage may be extracted by using $$SEARCH_META variable, e.g., via Projections.computedSearchMeta.

    operator

    A search operator.

    options

    Optional $search pipeline stage fields. Specifying SearchOptions.searchOptions is equivalent to calling Aggregates.searchMeta(SearchOperator).

    returns

    The $searchMeta pipeline stage.

    Since

    4.7

    See also

    $searchMeta

    Search operators

  55. def searchMeta(operator: SearchOperator): Bson

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas.

    Creates a $searchMeta pipeline stage supported by MongoDB Atlas. Unlike $search, it does not return found documents, instead it returns metadata, which in case of using the $search stage may be extracted by using $$SEARCH_META variable, e.g., via Projections.computedSearchMeta.

    operator

    A search operator.

    returns

    The $searchMeta pipeline stage.

    Since

    4.7

    See also

    $searchMeta

    Search operators

  56. def set(fields: Field[_]*): Bson

    Creates an $set pipeline stage

    Creates an $set pipeline stage

    fields

    the fields to add

    returns

    the $set pipeline stage

    Since

    4.3

    Note

    Requires MongoDB 4.2 or greater

    See also

    $set

  57. def setWindowFields[TExpression >: Null](partitionBy: Option[TExpression], sortBy: Option[Bson], output: Iterable[_ <: WindowOutputField]): Bson

    Creates a $setWindowFields pipeline stage, which allows using window operators.

    Creates a $setWindowFields pipeline stage, which allows using window operators. This stage partitions the input documents similarly to the $group pipeline stage, optionally sorts them, computes fields in the documents by computing window functions over windows specified per function, and outputs the documents. The important difference from the $group pipeline stage is that documents belonging to the same partition or window are not folded into a single document.

    TExpression

    The partitionBy expression type.

    partitionBy

    Optional partitioning of data specified like id in Aggregates.group. If None, then all documents belong to the same partition.

    sortBy

    Fields to sort by. The syntax is identical to sort in Aggregates.sort (see Sorts). Sorting is required by certain functions and may be required by some windows (see Windows for more details). Sorting is used only for the purpose of computing window functions and does not guarantee ordering of the output documents.

    output

    A nonempty list of window output fields. Specifying an empty list is not an error, but the resulting stage does not do anything useful.

    returns

    The $setWindowFields pipeline stage.

    Since

    4.3

    Note

    Requires MongoDB 5.0 or greater.

    See also

    $setWindowFields

  58. def setWindowFields[TExpression >: Null](partitionBy: Option[TExpression], sortBy: Option[Bson], output: WindowOutputField, moreOutput: WindowOutputField*): Bson

    Creates a $setWindowFields pipeline stage, which allows using window operators.

    Creates a $setWindowFields pipeline stage, which allows using window operators. This stage partitions the input documents similarly to the $group pipeline stage, optionally sorts them, computes fields in the documents by computing window functions over windows specified per function, and outputs the documents. The important difference from the $group pipeline stage is that documents belonging to the same partition or window are not folded into a single document.

    TExpression

    The partitionBy expression type.

    partitionBy

    Optional partitioning of data specified like id in Aggregates.group. If None, then all documents belong to the same partition.

    sortBy

    Fields to sort by. The syntax is identical to sort in Aggregates.sort (see Sorts). Sorting is required by certain functions and may be required by some windows (see Windows for more details). Sorting is used only for the purpose of computing window functions and does not guarantee ordering of the output documents.

    output

    A window output field.

    moreOutput

    More window output fields.

    returns

    The $setWindowFields pipeline stage.

    Since

    4.3

    Note

    Requires MongoDB 5.0 or greater.

    See also

    $setWindowFields

  59. def skip(skip: Int): Bson

    Creates a $skip pipeline stage

    Creates a $skip pipeline stage

    skip

    the number of documents to skip

    returns

    the $skip pipeline stage

    See also

    reference/operator/aggregation/skip/ $skip

  60. def sort(sort: Bson): Bson

    Creates a $sort pipeline stage for the specified sort specification

    Creates a $sort pipeline stage for the specified sort specification

    sort

    the sort specification

    See also

    Sorts

    $sort

  61. def sortByCount[TExpression](filter: TExpression): Bson

    Creates a $sortByCount pipeline stage for the specified filter

    Creates a $sortByCount pipeline stage for the specified filter

    TExpression

    the expression type

    filter

    the filter specification

    returns

    the $sortByCount pipeline stage

    Since

    1.2

    Note

    Requires MongoDB 3.4 or greater

    See also

    Sorts

    $sortByCount

  62. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  63. def toString(): String
    Definition Classes
    AnyRef → Any
  64. def unionWith(collection: String, pipeline: Bson*): Bson

    Creates a $unionWith pipeline stage.

    Creates a $unionWith pipeline stage.

    collection

    the name of the collection in the same database to perform the union with.

    pipeline

    the pipeline to run on the union.

    returns

    the $unionWith pipeline stage

    See also

    https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/

  65. def unset(fields: String*): Bson

    Creates an $unset pipeline stage that removes/excludes fields from documents

    Creates an $unset pipeline stage that removes/excludes fields from documents

    fields

    the fields to exclude. May use dot notation.

    returns

    the $unset pipeline stage

    Since

    4.8

    See also

    $unset

  66. def unwind(fieldName: String, unwindOptions: UnwindOptions): Bson

    Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a $ sign.

    Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a $ sign.

    fieldName

    the field name, prefixed by a $ sign

    returns

    the $unwind pipeline stage

    Since

    1.1

    See also

    $unwind

  67. def unwind(fieldName: String): Bson

    Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a $ sign.

    Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a $ sign.

    fieldName

    the field name, prefixed by a $ sign

    returns

    the $unwind pipeline stage

    See also

    $unwind

  68. def vectorSearch(path: FieldSearchPath, queryVector: Iterable[Double], index: String, limit: Long, options: VectorSearchOptions): Bson

    Creates a $vectorSearch pipeline stage supported by MongoDB Atlas.

    Creates a $vectorSearch pipeline stage supported by MongoDB Atlas. You may use the $meta: "vectorSearchScore" expression, e.g., via Projections.metaVectorSearchScore, to extract the relevance score assigned to each found document.

    path

    The field to be searched.

    queryVector

    The query vector. The number of dimensions must match that of the index.

    index

    The name of the index to use.

    limit

    The limit on the number of documents produced by the pipeline stage.

    options

    Optional $vectorSearch pipeline stage fields.

    returns

    The $vectorSearch pipeline stage.

    Since

    4.11

    Note

    Requires MongoDB 6.0.10 or greater

    See also

    $vectorSearch

  69. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  70. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  71. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped