replaceOneWithFilter
Replace a document in the collection according to the specified arguments. Same than MongoCollection.replaceOne but ensure that any _id present in replacement is removed to avoid MongoWriteException such as: "After applying the update, the (immutable) field '_id' was found to have been altered to _id"
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the replace one operation
Since
3.7
Parameters
the query filter to apply the the replace operation
the replacement document
the options to apply to the replace operation
Throws
if the write failed due some other failure specific to the replace command
if the write failed due being unable to fulfil the write concern
if the write failed due some other failure
Replace a document in the collection according to the specified arguments. Same than MongoCollection.replaceOne but ensure that any _id present in replacement is removed to avoid MongoWriteException such as: "After applying the update, the (immutable) field '_id' was found to have been altered to _id"
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the replace one operation
Since
3.7
Parameters
the client session with which to associate this operation
the query filter to apply the the replace operation
the replacement document
the options to apply to the replace operation
Throws
if the write failed due some other failure specific to the replace command
if the write failed due being unable to fulfil the write concern
if the write failed due some other failure