update One
Update a single document in the collection according to the specified arguments.
Use this method to only update the corresponding fields in the document according to the update operators used in the update document. To replace the entire document with a new document, use the corresponding replaceOne method.
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the update one operation
Parameters
a document describing the query filter, which may not be null.
a document describing the update, which may not be null. The update to apply must include at least one update operator.
the options to apply to the update operation
See also
Throws
if the write failed due to some specific write exception
if the write failed due to being unable to fulfil the write concern
if the write failed due to a specific command exception
if the write failed due some other failure
Update a single document in the collection according to the specified arguments.
Use this method to only update the corresponding fields in the document according to the update operators used in the update document. To replace the entire document with a new document, use the corresponding replaceOne method.
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the update one operation
Parameters
the client session with which to associate this operation
a document describing the query filter, which may not be null.
a document describing the update, which may not be null. The update to apply must include at least one update operator.
the options to apply to the update operation
See also
Throws
if the write failed due to some specific write exception
if the write failed due to being unable to fulfil the write concern
if the write failed due to a specific command exception
if the write failed due some other failure
Update a single document in the collection according to the specified arguments.
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the update one operation
Parameters
a document describing the query filter, which may not be null.
a pipeline describing the update, which may not be null.
the options to apply to the update operation
See also
Throws
if the write failed due some other failure specific to the update command
if the write failed due being unable to fulfil the write concern
if the write failed due some other failure
Update a single document in the collection according to the specified arguments.
Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.
Return
the result of the update one operation
Parameters
the client session with which to associate this operation
a document describing the query filter, which may not be null.
a pipeline describing the update, which may not be null.
the options to apply to the update operation
See also
Throws
if the write failed due some other failure specific to the update command
if the write failed due being unable to fulfil the write concern
if the write failed due some other failure