fun <reified T : Any> MongoCollection<T>.replaceOne(replacement: T, options: ReplaceOptions = ReplaceOptions()): Mono<UpdateResult>
(source)
Replace a document in the collection according to the specified arguments.
replacement
- the document to replace - must have an non null id
options
- the options to apply to the replace operation
fun <reified T : Any> MongoCollection<T>.replaceOne(clientSession: ClientSession, replacement: T, options: ReplaceOptions = ReplaceOptions()): Mono<UpdateResult>
(source)
Replace a document in the collection according to the specified arguments.
clientSession
- the client session
replacement
- the document to replace - must have an non null id
options
- the options to apply to the replace operation
fun <T : Any> MongoCollection<T>.replaceOne(filter: String, replacement: T, options: ReplaceOptions = ReplaceOptions()): Mono<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 update one operation
fun <T : Any> MongoCollection<T>.replaceOne(clientSession: ClientSession, filter: String, replacement: T, options: ReplaceOptions = ReplaceOptions()): Mono<UpdateResult>
(source)
Replace a document in the collection according to the specified arguments.
clientSession
- the client session
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 update one operation