QuantileMethod (driver-core 5.5.0 API) (original) (raw)
All Known Subinterfaces:
[ApproximateQuantileMethod](ApproximateQuantileMethod.html "interface in com.mongodb.client.model")
@Sealed public interface QuantileMethod
This interface represents a quantile method used in quantile accumulators of the $group
and$setWindowFields
stages.
It provides methods for creating and converting quantile methods to BsonValue.
Since:
4.10
See Also:
- Accumulators.percentile(String, Object, Object, QuantileMethod)
- Accumulators.median(String, Object, QuantileMethod)
- WindowOutputFields.percentile(String, Object, Object, QuantileMethod, Window)
- WindowOutputFields.median(String, Object, QuantileMethod, Window)
Since server release
Method Summary
Returns a QuantileMethod instance representing the "approximate" quantile method.
Creates a QuantileMethod from a BsonValue in situations when there is no builder method that better satisfies your needs.
Method Details
approximate
Returns a QuantileMethod instance representing the "approximate" quantile method.
Returns:
The requested QuantileMethod.of
Creates a QuantileMethod from a BsonValue 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 QuantileMethods, though they may not be equal.QuantileMethod method1 = QuantileMethod.approximate(); QuantileMethod method2 = QuantileMethod.of(new BsonString("approximate"));
Parameters:
method
- A BsonValue representing the required QuantileMethod.
Returns:
The requested QuantileMethod.toBsonValue
Returns:
A BsonValue representing this QuantileMethod.