Skip to content

Commit 1cfd451

Browse files
committed
feedback
1 parent ef63a45 commit 1cfd451

File tree

1 file changed

+30
-18
lines changed
  • source/fundamentals/crud/write-operations

1 file changed

+30
-18
lines changed

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

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ operations. You can perform bulk write operations at the following levels:
3030
- :ref:`Collection Level <java-sync-coll-bulk-write>`: You can use the
3131
``MongoCollection.bulkWrite()`` method to perform bulk write operations on a
3232
single collection. This method groups write operations together by the kind
33-
of operation. For example, ``MongoCollection.bulkWrite()`` puts multiple insert
34-
operations, including ``insertOne()`` and ``insertMany()``, in the same call,
35-
but will make two calls to the database for an insert operation and a replace
36-
operation.
33+
of operation. For example, ``MongoCollection.bulkWrite()`` puts multiple update
34+
operations in the same call, but makes two calls to the database for an insert
35+
operation and a replace operation.
3736

3837
- :ref:`Client Level <java-sync-client-bulk-write>`: When running {+mdb-server+}
3938
version 8.0 or later, you can use the ``MongoClient.bulkWrite()`` method to perform
@@ -45,17 +44,18 @@ operations. You can perform bulk write operations at the following levels:
4544
Collection Bulk Write
4645
---------------------
4746

48-
Bulk operations consist of many write operations. The
49-
``MongoCollection.bulkWrite()`` method splits operations of different kinds into
50-
different batches. For example, when the method is passed an ``insertOne()``,
51-
``insertMany()``, and ``replaceOne()`` operation, it will split the insert operations
52-
into one batch and the replace operation into another. During this process,
53-
the client may reorder operations for efficiency.
54-
55-
To perform a bulk operation at the collection level, pass a ``List`` of ``WriteModel``
56-
documents to the ``MongoCollection.bulkWrite()`` method. A ``WriteModel`` is a model that
47+
Bulk operations consist of many write operations. To perform a bulk operation
48+
at the collection level, pass a ``List`` of ``WriteModel`` documents to the
49+
``MongoCollection.bulkWrite()`` method. A ``WriteModel`` is a model that
5750
represents any of the write operations.
5851

52+
The ``MongoCollection.bulkWrite()`` method splits operations of different kinds into
53+
different batches. For example, when you pass ``DeleteOneModel``,
54+
``DeleteManyModel``, and ``ReplaceOneModel`` operations to the method, the method
55+
splits the delete operations into one batch and the replace operation
56+
into another. During this process, the client might reorder operations for
57+
efficiency if the bulk operation is not ordered.
58+
5959
The following sections show how to create and use each ``WriteModel``
6060
document. The examples in each section use the following documents in the
6161
``people`` collection:
@@ -336,11 +336,23 @@ list of ``ClientNamespacedWriteModel`` instances to represent different write op
336336
For example, an instance of ``ClientNamespacedInsertOneModel`` represents an
337337
operation to insert one document.
338338

339-
You can construct these ``ClientNamespacedWriteModel`` instances using different
340-
methods to represent write operations. ``ClientNamespacedWriteModel`` contains
341-
the methods ``insertOne()``, ``updateOne()``, ``updateMany()``, ``replaceOne()``,
342-
``deleteOne()``, and ``deleteMany()``. These methods are used to construct corresponding
343-
write models. For example, ``ClientNamespacedWriteModel.updateOne()`` is used to
339+
You can construct instances of ``ClientNamespacedWriteModel`` using the following
340+
methods:
341+
342+
- ``insertOne()``
343+
344+
- ``updateOne()``
345+
346+
- ``updateMany()``
347+
348+
- ``replaceOne()``
349+
350+
- ``deleteOne()``
351+
352+
- ``deleteMany()``
353+
354+
These methods are used to construct corresponding write models.
355+
For example, ``ClientNamespacedWriteModel.updateOne()`` is used to
344356
construct a ``ClientNamespacedUpdateOneModel`` instance, which represents an
345357
update operation.
346358

0 commit comments

Comments
 (0)