Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsArithmeticValueOperatorsdiv

div

open operator fun <Context : Any, Result> Value<Context, Result>.div(other: Value<Context, Result>): Value<Context, Result>

Divides one aggregation value by another.

Example

class ConferencePlanning(
    val hours: Int,
    val workdays: Double,
)

collection.updateManyWithPipeline {
    set {
        ConferencePlanning::workdays set (of(ConferencePlanning::hours) / of(8))
    }
}

External resources