MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.operators • ArithmeticValueOperators • minus
minus¶
Subtracts one aggregation value from another.
The second argument is subtracted from the first argument.
Example¶
class Sale(
val price: Int,
val fee: Int,
val discount: Int,
val total: Int,
)
collection.updateManyWithPipeline {
set {
Sale::total set (of(Sale::price) + of(Sale::fee) - of(Sale::discount))
}
}