kmongo / org.litote.kmongo.coroutine / CoroutineCollection / updateMany

updateMany

suspend fun updateMany(filter: Bson, update: Bson, options: UpdateOptions = UpdateOptions()): UpdateResult (source)

Update all documents in the collection according to the specified arguments.

Parameters

filter - a document describing the query filter, which may not be null.

update - a document describing the update, which may not be null. The update to apply must include only update operators.

options - the options to apply to the update operation

Return
the UpdateResult

Mongodb
.driver.manual tutorial/modify-documents/ Updates

Mongodb
.driver.manual reference/operator/update/ Update Operators

suspend fun updateMany(clientSession: ClientSession, filter: Bson, update: Bson, options: UpdateOptions = UpdateOptions()): UpdateResult (source)

Update all documents in the collection according to the specified arguments.

Parameters

clientSession - the client session with which to associate this operation

filter - a document describing the query filter, which may not be null.

update - a document describing the update, which may not be null. The update to apply must include only update operators.

options - the options to apply to the update operation

Return
the UpdateResult

Mongodb
.driver.manual tutorial/modify-documents/ Updates

Mongodb
.driver.manual reference/operator/update/ Update Operators

Mongodb
.server.release 3.6

Since
1.7

suspend fun updateMany(filter: String, update: String, updateOptions: UpdateOptions = UpdateOptions()): UpdateResult (source)
suspend fun updateMany(filter: Bson, vararg updates: SetTo<*>, updateOptions: UpdateOptions = UpdateOptions()): UpdateResult (source)

Update all documents in the collection according to the specified arguments.

Parameters

filter - a document describing the query filter

update - a document describing the update. The update to apply must include only update operators.

updateOptions - the options to apply to the update operation

Return
the result of the update many operation

suspend fun updateMany(clientSession: ClientSession, filter: String, update: String, updateOptions: UpdateOptions = UpdateOptions()): UpdateResult (source)
suspend fun updateMany(clientSession: ClientSession, filter: Bson, vararg updates: SetTo<*>, updateOptions: UpdateOptions = UpdateOptions()): UpdateResult (source)

Update all documents in the collection according to the specified arguments.

Parameters

clientSession - the client session with which to associate this operation

filter - a document describing the query filter

update - a document describing the update. The update to apply must include only update operators.

updateOptions - the options to apply to the update operation

Return
the result of the update many operation