File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ Definition
72
72
Starting in MongoDB 4.0.12+ (and 3.6.14+ and 3.4.23+), the operation errors if the query argument
73
73
is not a document.
74
74
75
+ If no document matches the ``filter``, no document is updated.
75
76
76
-
77
77
* - ``update``
78
78
79
79
- document
@@ -157,16 +157,10 @@ Definition
157
157
modify for an update operation on an array field.
158
158
159
159
.. include:: /includes/extracts/arrayFilters-details.rst
160
-
161
-
160
+
162
161
For examples, see :ref:`findOneAndUpdate-arrayFilters`.
163
162
164
163
.. versionadded:: 3.6
165
-
166
-
167
-
168
-
169
-
170
164
171
165
:returns:
172
166
@@ -180,7 +174,9 @@ Document Match
180
174
~~~~~~~~~~~~~~
181
175
182
176
: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
+
184
180
The ``sort`` parameter can be used to influence which document is updated.
185
181
186
182
Projection
You can’t perform that action at this time.
0 commit comments