Class RangeOptions

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

@Beta(SERVER) public class RangeOptions extends Object
Range options specifies index options for a Queryable Encryption field supporting "rangePreview" 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.

Note: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.

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