UpdateQuery
DSL for MongoDB operators that are used to update existing values (does not include aggregation operators).
Example
This expression type is available on multiple operations, most commonly update:
class User(
val name: String,
val age: Int,
)
collection.update(
filter = {
User::name eq "Bob"
},
update = {
User::age set 18
}
)Operators
On regular fields:
On arrays:
Time management:
If you can't find the operator you're searching for, visit the tracking issue.
External resources
See also
Filters
Inheritors
Functions
Adds a new node as a child of this one.
Adds any number of nodes into this one.
Refers to child as a nested field of the current field.
Makes this expression immutable.
Refers to a specific item in an array, by its index.
Refers to a specific item in a map, by its name.
Increments a field by the specified amount.
Sets this field to the current date.
Sets this field to the current timestamp.
Returns a simplified (but equivalent) expression to the current expression.
Writes the result of simplifying to a new BSON document.
Writes the result of simplifying this expression into writer.