Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsArithmeticValueOperatorsceil

ceil

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

The smallest integer greater 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 maxBound: Double,
)

collection.aggregate()
    .set {
        Sensor::maxBound set ceil(of(Sensor::value))
    }.toList()

External resources