Skip to content

Commit 2b359a6

Browse files
jason-price-mongodbjason-price-mongodb
and
jason-price-mongodb
committed
DOCSP-12376 findOneAndUpdate change (mongodb#6025)
Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 80548c9 commit 2b359a6

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Definition
7575
Starting in MongoDB 4.2 (and 4.0.12+, 3.6.14+, and 3.4.23+), the operation
7676
errors if the query argument is not a document.
7777

78+
If no document matches the ``filter``, no document is updated.
7879

79-
8080
* - ``update``
8181

8282
- document or array
@@ -176,21 +176,14 @@ Definition
176176
modify for an update operation on an array field.
177177

178178
.. include:: /includes/extracts/arrayFilters-details.rst
179-
180-
181-
179+
182180
For examples, see :ref:`findOneAndUpdate-arrayFilters`.
183181

184182
.. note::
185183

186184
.. include:: /includes/extracts/arrayFilters-update-aggregation-restriction.rst
187185

188186
.. versionadded:: 3.6
189-
190-
191-
192-
193-
194187

195188
:returns:
196189

@@ -204,7 +197,9 @@ Document Match
204197
~~~~~~~~~~~~~~
205198

206199
:method:`db.collection.findOneAndUpdate()` updates the first matching
207-
document in the collection that matches the ``filter``.
200+
document in the collection that matches the ``filter``. If no document
201+
matches the ``filter``, no document is updated.
202+
208203
The ``sort`` parameter can be used to influence which document is updated.
209204

210205
Projection

0 commit comments

Comments
 (0)