Packages

  • package root

    This is the documentation for the MongoDB Scala driver.

    This is the documentation for the MongoDB Scala driver.

    Driver structure

    The mongodb scala driver.

    To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.

    Notable packages include:

    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package mongodb
    Definition Classes
    org
  • package scala

    The MongoDB Scala Driver package

    The MongoDB Scala Driver package

    Contains type aliases and companion objects to help when using the Scala API

    Definition Classes
    mongodb
    Since

    1.0

  • package model

    The model package containing models and options that help describe MongoCollection operations

    The model package containing models and options that help describe MongoCollection operations

    Definition Classes
    scala
  • object Windows

    Builders for windows used when expressing window output fields.

    Builders for windows used when expressing window output fields. There are two types of windows: documents and range.

    Bounded and half-bounded windows require sorting. Window bounds are inclusive and the lower bound must always be less than or equal to the upper bound. The following type-specific rules are applied to windows:

    • documents
      • bounds
        • 0 refers to the current document and is functionally equivalent to CURRENT;
        • a negative value refers to documents preceding the current one;
        • a positive value refers to documents following the current one;
    • range
      • sortBy (see Aggregates.setWindowFields)
        • must contain exactly one field;
        • must specify the ascending sort order;
        • the sortBy field must be of either a numeric BSON type (see the $isNumber aggregation pipeline stage) or the BSON Date type if time bounds are used;
      • bounds
        • if numeric, i.e., not com.mongodb.client.model.Windows.Bound, then the bound is calculated by adding the value to the value of the sortBy field in the current document;
        • if CURRENT, then the bound is determined by the current document and not the current value of the sortBy field;
        • time bounds require specifying a time unit and are added as per the $dateAdd/$dateSubtract aggregation pipeline stage specification.
    Definition Classes
    model
    Annotations
    @Beta()
    Since

    4.3

    Note

    Requires MongoDB 5.0 or greater.

    See also

    WindowOutputField

    $isNumber aggregation pipeline stage

    BSON Date type

    $dateAdd aggregation pipeline stage

    $dateSubtract aggregation pipeline stage

  • Bound

object Bound

Special values that may be used when specifying the bounds of a window.

Annotations
@Beta()
Since

4.3

Note

Requires MongoDB 5.0 or greater.

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

Value Members

  1. val CURRENT: Bound

    The window bound is the same as the corresponding bound of the partition encompassing it.

  2. val UNBOUNDED: Bound

    The window bound is determined by the current document and is inclusive.