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
}
)
Content copied to clipboard
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
Link copied to clipboard
open operator fun <Root, Type> KProperty1<Root, Collection<Type>>.get(index: Int): Field<Root, Type>
Refers to a specific item in an array, by its index.
open operator fun <Root, Type> KProperty1<Root, Map<String, Type>>.get(index: String): Field<Root, Type>
Refers to a specific item in a map, by its name.
Link copied to clipboard
Increments a field by the specified amount.
Link copied to clipboard
Link copied to clipboard
Sets this field to the current date.
Sets this field to the current timestamp.
Link copied to clipboard
Writes the result of simplifying to a new Bson.
Link copied to clipboard
Writes the result of simplifying this expression into writer.