diff --git a/source/reference/method/db.collection.findOneAndUpdate.txt b/source/reference/method/db.collection.findOneAndUpdate.txt index b2dae10d518..13a093a69ab 100644 --- a/source/reference/method/db.collection.findOneAndUpdate.txt +++ b/source/reference/method/db.collection.findOneAndUpdate.txt @@ -75,8 +75,8 @@ Definition Starting in MongoDB 4.2 (and 4.0.12+, 3.6.14+, and 3.4.23+), the operation errors if the query argument is not a document. + If no document matches the ``filter``, no document is updated. - * - ``update`` - document or array @@ -176,9 +176,7 @@ Definition modify for an update operation on an array field. .. include:: /includes/extracts/arrayFilters-details.rst - - - + For examples, see :ref:`findOneAndUpdate-arrayFilters`. .. note:: @@ -186,11 +184,6 @@ Definition .. include:: /includes/extracts/arrayFilters-update-aggregation-restriction.rst .. versionadded:: 3.6 - - - - - :returns: @@ -204,7 +197,9 @@ Document Match ~~~~~~~~~~~~~~ :method:`db.collection.findOneAndUpdate()` updates the first matching -document in the collection that matches the ``filter``. +document in the collection that matches the ``filter``. If no document +matches the ``filter``, no document is updated. + The ``sort`` parameter can be used to influence which document is updated. Projection