suspend fun replaceOne(filter: Bson, replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult
(source)
Replace a document in the collection according to the specified arguments.
filter
- the query filter to apply the the replace operation
replacement
- the replacement document
options
- the options to apply to the replace operation
Return
he UpdateResult
Mongodb
.driver.manual tutorial/modify-documents/#replace-the-document Replace
Since
1.8
suspend fun replaceOne(clientSession: ClientSession, filter: Bson, replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult
(source)
Replace a document in the collection according to the specified arguments.
clientSession
- the client session with which to associate this operation
filter
- the query filter to apply the the replace operation
replacement
- the replacement document
options
- the options to apply to the replace operation
Return
the UpdateResult
Mongodb
.driver.manual tutorial/modify-documents/#replace-the-document Replace
Mongodb
.server.release 3.6
Since
1.8
suspend fun replaceOne(filter: String, replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult
(source)
Replace a document in the collection according to the specified arguments.
filter
- the query filter to apply to the replace operation
replacement
- the replacement document
options
- the options to apply to the replace operation
Return
the result of the replace one operation