@@ -65,7 +65,7 @@ Then, pass a list of these instances to the ``bulk_write()`` method.
65
65
66
66
.. important::
67
67
68
- Ensure that you import the write operation instances into your application
68
+ Ensure that you import the write operation classes into your application
69
69
file, as shown in the following code:
70
70
71
71
.. code-block:: python
@@ -79,12 +79,12 @@ Insert Operations
79
79
~~~~~~~~~~~~~~~~~
80
80
81
81
To perform an insert operation, create an instance of ``InsertOne`` and specify
82
- the document you want to insert. Pass the following arguments to the
82
+ the document you want to insert. Pass the following keyword arguments to the
83
83
``InsertOne`` constructor:
84
84
85
- - Namespace in which to insert the document. This argument is optional if
86
- you perform the bulk operation on a single collection.
87
- - Document to insert.
85
+ - ``namespace``: The namespace in which to insert the document. This argument
86
+ is optional if you perform the bulk operation on a single collection.
87
+ - ``document``: The document to insert.
88
88
89
89
The following example creates an instance of ``InsertOne``:
90
90
@@ -108,10 +108,11 @@ Update Operations
108
108
To update a document, create an instance of ``UpdateOne`` and pass in
109
109
the following arguments:
110
110
111
- - Namespace in which to perform the update. This argument is optional if
111
+ - ``namespace``: The namespace in which to perform the update. This argument is optional if
112
112
you perform the bulk operation on a single collection.
113
- - **Query filter** that specifies the criteria used to match documents in your collection.
114
- - Update operation you want to perform. For more information about update
113
+ - ``filter``: The **query filter** that specifies the criteria used to match documents in
114
+ your collection.
115
+ - ``update``: The update you want to perform. For more information about update
115
116
operations, see the :manual:`Field Update Operators
116
117
</reference/operator/update-field/>` guide in the {+mdb-server+} manual.
117
118
@@ -144,10 +145,11 @@ A replace operation removes all fields and values of a specified document and
144
145
replaces them with new ones. To perform a replace operation, create an instance
145
146
of ``ReplaceOne`` and pass in the following arguments:
146
147
147
- - Namespace in which to perform the replace operation. This argument is optional if
148
- you perform the bulk operation on a single collection.
149
- - **Query filter** that specifies the criteria used to match the document to replace.
150
- - Document that includes the new fields and values you want
148
+ - ``namespace``: The namespace in which to perform the replace operation. This
149
+ argument is optional if you perform the bulk operation on a single collection.
150
+ - ``filter``: The **query filter** that specifies the criteria used to match the
151
+ document to replace.
152
+ - ``replacement``: The document that includes the new fields and values you want
151
153
to store in the matching document.
152
154
153
155
The following example creates an instance of ``ReplaceOne``:
@@ -166,9 +168,10 @@ Delete Operations
166
168
To delete a document, create an instance of ``DeleteOne`` and pass in
167
169
the following arguments:
168
170
169
- - Namespace in which to delete the document. This argument is optional if
170
- you perform the bulk operation on a single collection.
171
- - **Query filter** that specifies the criteria used to match the document to delete.
171
+ - ``namespace``: The namespace in which to delete the document. This argument is
172
+ optional if you perform the bulk operation on a single collection.
173
+ - ``filter``: The **query filter** that specifies the criteria used to match the
174
+ document to delete.
172
175
173
176
``DeleteOne`` removes only *the first* document that matches your query filter.
174
177
@@ -220,6 +223,9 @@ information about the exception.
220
223
method. The driver reports all write concern errors after attempting all operations,
221
224
regardless of execution order.
222
225
226
+ To learn more about write concerns, see :manual:`Write Concern </reference/write-concern/>`
227
+ in the {+mdb-server+} manual.
228
+
223
229
.. _pymongo-bulk-write-collection-ex:
224
230
225
231
Collection Bulk Write Example
@@ -275,8 +281,7 @@ Customize Bulk Write Operations
275
281
276
282
The ``bulk_write()`` method optionally accepts additional
277
283
parameters, which represent options you can use to configure the bulk write
278
- operation. If you don't specify any additional options, the driver does not customize
279
- the bulk write operation.
284
+ operation.
280
285
281
286
Collection Bulk Write Options
282
287
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments