Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsArithmeticValueOperatorsplus

plus

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

Sums two aggregation values.

Example

class Product(
    val name: String,
    val price: Int,
    val dailyPriceIncrease: Int,
)

collection.updateManyWithPipeline {
    set {
        Product::price set (of(Product::price) + of(Product::dailyPriceIncrease))
    }
}

External resources