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.
628
628
Troubleshooting
629
629
---------------
630
630
631
+ Bulk Write Exception
632
+ ~~~~~~~~~~~~~~~~~~~~
633
+
631
634
If the driver encounters an error during a bulk write operation, the driver
632
635
throws a `MongoBulkWriteException.
633
636
<{+core-api+}/MongoBulkWriteException.html>`__ A ``MongoBulkWriteException``
634
637
contains a ``writeErrors`` field consisting of a list of one or more
635
638
``WriteError`` objects associated with the same bulk write operation.
636
639
637
640
Consider 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"``.
641
645
642
646
.. code-block:: none
643
647
:copyable: false
@@ -664,9 +668,6 @@ value of ``"three"`` and another with a ``quantity`` field value of ``"ten"``.
664
668
com.mongodb.internal.connection.ProtocolHelper.getBulkWriteException(ProtocolHelper.java:254)
665
669
... 19 more
666
670
667
- To learn more about the ``MongoBulkWriteException`` and ``WriteError`` types,
668
- see MongoBulkWriteException and WriteError in the API Documentation section.
669
-
670
671
Additional Information
671
672
----------------------
672
673
Original file line number Diff line number Diff line change @@ -194,15 +194,18 @@ operation and an insert many operation:
194
194
Troubleshooting
195
195
---------------
196
196
197
+ Write Exception
198
+ ~~~~~~~~~~~~~~~
199
+
197
200
The driver throws a `MongoWriteException
198
201
<{+core-api+}/MongoWriteException.html>`__ for any write errors that occur when
199
202
performing single write operations. A ``MongoWriteException`` object has an
200
203
``error`` field containing the ``WriteError`` object that caused it.
201
204
202
205
Consider 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"``.
206
209
207
210
.. code-block:: none
208
211
:copyable: false
@@ -217,9 +220,8 @@ thrown if you attempt to insert a document where the value of ``quantity`` is
217
220
offendingDocument: {"name":"Apple","quantity":"three"} } } at
218
221
com.mongodb.internal.connection.WriteResultHelper.createWriteException(WriteResultHelper.java:50)
219
222
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.
223
225
224
226
Additional Information
225
227
----------------------
You can’t perform that action at this time.
0 commit comments