Class RangeOptions

java.lang.Object
com.mongodb.client.model.vault.RangeOptions

public class RangeOptions extends Object
Range options specifies index options for a Queryable Encryption field supporting "range" queries.

min, max, sparsity, and precision must match the values set in the encryptedFields of the destination collection.

For double and decimal128, min/max/precision must all be set, or all be unset.

Since:
4.9
MongoDB documentation
queryable encryption
Since server release
6.2
  • Constructor Details

    • RangeOptions

      public RangeOptions()
      Construct a new instance
  • Method Details

    • min

      public RangeOptions min(@Nullable BsonValue min)
      Set the minimum value set in the encryptedFields of the destination collection.
      Parameters:
      min - the minimum value
      Returns:
      this
    • getMin

      @Nullable public BsonValue getMin()
      Returns:
      the minimum value if set
    • max

      public RangeOptions max(@Nullable BsonValue max)
      Set the maximum value set in the encryptedFields of the destination collection.
      Parameters:
      max - the maximum value
      Returns:
      this
    • getTrimFactor

      @Nullable public Integer getTrimFactor()
      Returns:
      the trim factor value if set
      Since:
      5.2
    • trimFactor

      public RangeOptions trimFactor(@Nullable Integer trimFactor)
      Set the number of top-level edges stored per record.

      The trim factor may be used to tune performance.

      Parameters:
      trimFactor - the trim factor
      Returns:
      this
      Since:
      5.2
    • getMax

      @Nullable public BsonValue getMax()
      Returns:
      the maximum value if set
    • sparsity

      public RangeOptions sparsity(@Nullable Long sparsity)
      Set the Queryable Encryption range hypergraph sparsity factor.

      Sparsity may be used to tune performance.

      Parameters:
      sparsity - the sparsity
      Returns:
      this
    • getSparsity

      @Nullable public Long getSparsity()
      Returns:
      the sparsity value if set
    • precision

      public RangeOptions precision(@Nullable Integer precision)
      Set the precision of double or decimal128 values in the encryptedFields of the destination collection.
      Parameters:
      precision - the precision
      Returns:
      this
    • getPrecision

      @Nullable public Integer getPrecision()
      Returns:
      the precision value if set
    • toString

      public String toString()
      Overrides:
      toString in class Object