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
  • package densify

    Definition Classes
    model
    Since

    4.7

    Note

    Requires MongoDB 5.1 or greater.

    See also

    Aggregates.densify

  • DensifyOptions
  • DensifyRange

object DensifyRange

A specification of how to compute the missing field values for which new documents must be added. It specifies a half-closed interval of values with the lower bound being inclusive, and a step. The first potentially missing value within each interval is its lower bound, other values are computed by adding the step multiple times, until the result is out of the interval. Each time the step is added, the result is a potentially missing value for which a new document must be added if the sequence of documents that is being densified does not have a document with equal value of the field.

Since

4.7

Note

Requires MongoDB 5.1 or greater.

See also

Aggregates.densify

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

Value Members

  1. def fullRangeWithStep(step: Long, unit: MongoTimeUnit): DateDensifyRange

    Returns a DensifyRange that represents an interval with the smallest BSON Date value of the field in the sequence of documents being its lower bound, and the largest value being the upper bound.

    Returns a DensifyRange that represents an interval with the smallest BSON Date value of the field in the sequence of documents being its lower bound, and the largest value being the upper bound.

    step

    The positive step.

    unit

    The unit in which the step is specified.

    returns

    The requested DensifyRange.

  2. def fullRangeWithStep(step: Number): NumberDensifyRange

    Returns a DensifyRange that represents an interval with the smallest BSON 32-bit integer / 64-bit integer / Double / Decimal128 value of the field in the sequence of documents being its lower bound, and the largest value being the upper bound.

    Returns a DensifyRange that represents an interval with the smallest BSON 32-bit integer / 64-bit integer / Double / Decimal128 value of the field in the sequence of documents being its lower bound, and the largest value being the upper bound.

    step

    The positive step.

    returns

    The requested DensifyRange.

  3. def of(range: Bson): DensifyRange

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

    Creates a DensifyRange from a 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 equivalent DensifyRanges, though they may not be equal.

    val range1 = DensifyRange.partitionRangeWithStep(
      1, MongoTimeUnit.MINUTE)
    val range2 = DensifyRange.of(Document("bounds" -> "partition",
      "step" -> 1, "unit" -> MongoTimeUnit.MINUTE.value()))
    range

    A Bson representing the required DensifyRange.

    returns

    The requested DensifyRange.

  4. def partitionRangeWithStep(step: Long, unit: MongoTimeUnit): DateDensifyRange

    Returns a DensifyRange that represents an interval with the smallest BSON Date value of the field in the partition of documents being its lower bound, and the largest value being the upper bound.

    Returns a DensifyRange that represents an interval with the smallest BSON Date value of the field in the partition of documents being its lower bound, and the largest value being the upper bound.

    step

    The positive step.

    unit

    The unit in which the step is specified.

    returns

    The requested DensifyRange.

  5. def partitionRangeWithStep(step: Number): NumberDensifyRange

    Returns a DensifyRange that represents an interval with the smallest BSON 32-bit integer / 64-bit integer / Double / Decimal128 value of the field in the partition of documents being its lower bound, and the largest value being the upper bound.

    Returns a DensifyRange that represents an interval with the smallest BSON 32-bit integer / 64-bit integer / Double / Decimal128 value of the field in the partition of documents being its lower bound, and the largest value being the upper bound.

    step

    The positive step.

    returns

    The requested DensifyRange.

  6. def rangeWithStep(l: Instant, u: Instant, step: Long, unit: MongoTimeUnit): DateDensifyRange

    Returns a DensifyRange that represents a single interval [l, u).

    Returns a DensifyRange that represents a single interval [l, u).

    l

    The lower bound.

    u

    The upper bound.

    step

    The positive step.

    unit

    The unit in which the step is specified.

    returns

    The requested DensifyRange.

  7. def rangeWithStep(l: Number, u: Number, step: Number): NumberDensifyRange

    Returns a DensifyRange that represents a single interval [l, u).

    Returns a DensifyRange that represents a single interval [l, u).

    l

    The lower bound.

    u

    The upper bound.

    step

    The positive step.

    returns

    The requested DensifyRange.