updateMany

fun updateMany(options: UpdateOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, update: UpdateQuery<Document>.() -> Unit)(source)

Updates all documents that match filter according to update.

Example

class User(
val name: String,
val age: Int,
)

collection.bulkWrite {
updateMany(
filter = { User::name eq "Patrick" },
update = {
User::age set 15
}
)
}

External resources

See also

Update a single document.