You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/fundamentals/crud/write-operations/modify.txt
+60-17Lines changed: 60 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Update
44
44
45
45
Update operations can modify fields and values. They apply changes
46
46
specified in an update document to one or more documents that match your
47
-
query filter.
47
+
query filter.
48
48
49
49
The `updateOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__
50
50
method changes the first document your query filter matches and the
@@ -66,30 +66,62 @@ Update Operation Parameters
66
66
The ``updateOne()`` and ``updateMany()`` methods both have the following
67
67
parameters:
68
68
69
-
- ``query`` specifies a query filter with the criteria to match documents to update in your collection
70
-
- ``updateDocument`` specifies the fields and values to modify in the matching document or documents. For this example, we use the :doc:`Updates builder </fundamentals/builders/updates>` to create the update document.
69
+
- ``query`` specifies a query filter with the criteria to match
70
+
documents to update in your collection.
71
+
- ``update`` specifies the fields and values to modify in the matching
72
+
document or documents. For this example, we use the :doc:`Updates
73
+
builder </fundamentals/builders/updates>` to create the update
74
+
document.
75
+
- *(Optional)* ``updateOptions`` specifies options that you can set to
76
+
customize how the driver performs the update operation.
71
77
72
78
You can create the ``updateDocument`` using an ``Updates`` builder as
0 commit comments