Object

org.mongodb.scala.model

Windows

Related Doc: package model

Permalink

object Windows

Builders for windows used when expressing windowed computations. 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:

Annotations
@Beta()
Since

4.3

Note

Requires MongoDB 5.0 or greater.

See also

$dateSubtract aggregation pipeline stage

$dateAdd aggregation pipeline stage

BSON Date type

$isNumber aggregation pipeline stage

WindowedComputation

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

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Bound

    Permalink

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

    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.

  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  7. def documents(lower: Bound, upper: Bound): Window

    Permalink

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed documents window.

  8. def documents(lower: Int, upper: Bound): Window

    Permalink

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed documents window.

  9. def documents(lower: Bound, upper: Int): Window

    Permalink

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed documents window.

    Note

    Requires MongoDB 5.0 or greater.

  10. def documents(lower: Int, upper: Int): Window

    Permalink

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    Creates a documents window whose bounds are determined by a number of documents before and after the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed documents window.

  11. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  15. final def isInstanceOf[T0]: Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  19. def of(window: Bson): Window

    Permalink

    Creates a window from Bson in situations when there is no builder method that better satisfies your needs.

    Creates a window from Bson in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.

    Example
    The following code creates two functionally identical windows, though they may not be equal.

    val pastWeek1: Window = Windows.timeRange(-1, MongoTimeUnit.WEEK, Windows.Bound.CURRENT)
    val pastWeek2: Window = Windows.of(
        Document("range" -> BsonArray(-1, "current"),
            "unit" -> BsonString("week")))
    window

    A Bson representing the required window.

    returns

    The constructed window.

  20. def range(lower: Decimal128, upper: Bound): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  21. def range(lower: Double, upper: Bound): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  22. def range(lower: Long, upper: Bound): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  23. def range(lower: Bound, upper: Decimal128): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  24. def range(lower: Bound, upper: Double): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  25. def range(lower: Bound, upper: Long): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  26. def range(lower: Decimal128, upper: Decimal128): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  27. def range(lower: Double, upper: Double): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  28. def range(lower: Long, upper: Long): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def timeRange(lower: Long, unit: MongoTimeUnit, upper: Bound): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    unit

    A time unit in which lower is specified.

    upper

    A value based on which the upper bound of the window is calculated.

    returns

    The constructed range window.

  31. def timeRange(lower: Bound, upper: Long, unit: MongoTimeUnit): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    unit

    A time unit in which upper is specified.

    returns

    The constructed range window.

  32. def timeRange(lower: Long, upper: Long, unit: MongoTimeUnit): Window

    Permalink

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    Creates a dynamically-sized range window whose bounds are determined by a range of possible values around the BSON Date value of the sortBy field in the current document.

    lower

    A value based on which the lower bound of the window is calculated.

    upper

    A value based on which the upper bound of the window is calculated.

    unit

    A time unit in which lower and upper are specified.

    returns

    The constructed range window.

  33. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped