mul
Multiplies a field by the specified amount.
If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), the field is created with an initial value of 0.
Use of this operator with a field with a null
value will generate an error.
Example
class User(
val name: String,
val price: Double,
)
collection.updateMany {
User::price mul 2.0
}
Content copied to clipboard