Skip to content

Commit 4b05e53

Browse files
committed
DOCSP-47275: Add note about UpdateOne sort functionality
1 parent 765ad11 commit 4b05e53

File tree

1 file changed

+6
-0
lines changed
  • source/fundamentals/crud/write-operations

1 file changed

+6
-0
lines changed

source/fundamentals/crud/write-operations/modify.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ Update documents use the following format:
9090
See the MongoDB server manual for a :manual:`complete list of update operators
9191
and descriptions </reference/operator/update-field/>`.
9292

93+
.. tip::
94+
95+
``UpdateOne()`` updates the first document that matches the query filter
96+
you provide. To ensure that you update the correct document, You can use the ``sort``
97+
option to specify the order in which the operation finds documents.
98+
9399
.. note:: Aggregation Pipelines in Update Operations
94100

95101
If you are using MongoDB Server version 4.2 or later, you can use aggregation

0 commit comments

Comments
 (0)