File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -628,16 +628,20 @@ unordered.
628628Troubleshooting
629629---------------
630630
631+ Bulk Write Exception
632+ ~~~~~~~~~~~~~~~~~~~~
633+
631634If the driver encounters an error during a bulk write operation, the driver
632635throws a `MongoBulkWriteException.
633636<{+core-api+}/MongoBulkWriteException.html>`__ A ``MongoBulkWriteException``
634637contains a ``writeErrors`` field consisting of a list of one or more
635638``WriteError`` objects associated with the same bulk write operation.
636639
637640Consider a collection that has a rule where the value of the ``quantity`` field
638- must be an ``int`` type. In the following example, a ``MongoBulkWriteException``
639- is thrown when when you attempt to insert a document with a ``quantity`` field
640- value of ``"three"`` and another with a ``quantity`` field value of ``"ten"``.
641+ must be an ``int`` type. In the following example, the driver throws a
642+ ``MongoBulkWriteException`` when you attempt to insert a document with a
643+ ``quantity`` field value of ``"three"`` and another with a ``quantity`` field
644+ value of ``"ten"``.
641645
642646.. code-block:: none
643647 :copyable: false
@@ -664,9 +668,6 @@ value of ``"three"`` and another with a ``quantity`` field value of ``"ten"``.
664668 com.mongodb.internal.connection.ProtocolHelper.getBulkWriteException(ProtocolHelper.java:254)
665669 ... 19 more
666670
667- To learn more about the ``MongoBulkWriteException`` and ``WriteError`` types,
668- see MongoBulkWriteException and WriteError in the API Documentation section.
669-
670671Additional Information
671672----------------------
672673
Original file line number Diff line number Diff line change @@ -194,15 +194,18 @@ operation and an insert many operation:
194194Troubleshooting
195195---------------
196196
197+ Write Exception
198+ ~~~~~~~~~~~~~~~
199+
197200The driver throws a `MongoWriteException
198201<{+core-api+}/MongoWriteException.html>`__ for any write errors that occur when
199202performing single write operations. A ``MongoWriteException`` object has an
200203``error`` field containing the ``WriteError`` object that caused it.
201204
202205Consider a collection with a rule where the value of the ``quantity`` field must
203- be an ``int`` type. In the following example, a ``MongoBulkWriteException`` is
204- thrown if you attempt to insert a document where the value of ``quantity`` is
205- ``"three"``.
206+ be an ``int`` type. In the following example, the driver throws a
207+ ``MongoWriteException`` if you attempt to insert a document where the value of
208+ ``quantity`` is `` "three"``.
206209
207210.. code-block:: none
208211 :copyable: false
@@ -217,9 +220,8 @@ thrown if you attempt to insert a document where the value of ``quantity`` is
217220 offendingDocument: {"name":"Apple","quantity":"three"} } } at
218221 com.mongodb.internal.connection.WriteResultHelper.createWriteException(WriteResultHelper.java:50)
219222
220- To learn more about the ``MongoWriteException`` and ``WriteError`` types,
221- see MongoWriteException and WriteError in the API Documentation section. To learn
222- more about schema validation, see Schema Validation in the Server Manual Entries section.
223+ To learn more about schema validation, see Schema Validation in the Server
224+ Manual Entries section.
223225
224226Additional Information
225227----------------------
You can’t perform that action at this time.
0 commit comments