abs
open fun <Context : Any, Result : Number?> abs(value: Value<Context, Result>): Value<Context, Result>(source)
The absolute value of a number.
If the value is null
or NaN
, it is returned unchanged.
Example
class Sensor(
val name: String,
val startTemp: Int,
val endTemp: Int,
val diffTemp: Int,
)
collection.updateManyWithPipeline(filter = { Sensor::diffTemp.isNull() }) {
set {
Sensor::diffTemp set abs(of(Sensor::startTemp) - of(Sensor::endTemp))
}
}
Content copied to clipboard