Skip to content

Commit 7437c7c

Browse files
jason-price-mongodbjason-price-mongodb
and
jason-price-mongodb
authored
DOCSP-12376 findOneAndUpdate change (#6025) (#6029)
Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 73e08fd commit 7437c7c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

source/reference/method/db.collection.findOneAndUpdate.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Definition
7272
Starting in MongoDB 4.0.12+ (and 3.6.14+ and 3.4.23+), the operation errors if the query argument
7373
is not a document.
7474

75+
If no document matches the ``filter``, no document is updated.
7576

76-
7777
* - ``update``
7878

7979
- document
@@ -157,16 +157,10 @@ Definition
157157
modify for an update operation on an array field.
158158

159159
.. include:: /includes/extracts/arrayFilters-details.rst
160-
161-
160+
162161
For examples, see :ref:`findOneAndUpdate-arrayFilters`.
163162

164163
.. versionadded:: 3.6
165-
166-
167-
168-
169-
170164

171165
:returns:
172166

@@ -180,7 +174,9 @@ Document Match
180174
~~~~~~~~~~~~~~
181175

182176
:method:`db.collection.findOneAndUpdate()` updates the first matching
183-
document in the collection that matches the ``filter``.
177+
document in the collection that matches the ``filter``. If no document
178+
matches the ``filter``, no document is updated.
179+
184180
The ``sort`` parameter can be used to influence which document is updated.
185181

186182
Projection

0 commit comments

Comments
 (0)