Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsArithmeticValueOperatorsfloor

floor

open fun <Context : Any, Result : Number?> floor(value: Value<Context, Result>): Value<Context, Result>

The largest integer less than or equal to the specified value.

If the value is null or NaN, it is returned unchanged.

Example

class Sensor(
    val value: Double,
    val minBound: Double,
)

collection.aggregate()
    .set {
        Sensor::minBound set floor(of(Sensor::value))
    }.toList()

External resources