@@ -623,6 +623,8 @@ Even though the write operation inserting a document with a duplicate key result
623623in an error, the other operations are executed because the write operation is
624624unordered.
625625
626+ .. _java-bulk-insert-troubleshooting:
627+
626628Troubleshooting
627629---------------
628630
@@ -631,7 +633,7 @@ Troubleshooting
631633Bulk Write Exception
632634~~~~~~~~~~~~~~~~~~~~
633635
634- The driver creates write exceptions when a ``WriteError`` object is created. If an
636+ The driver creates a write exception when a ``WriteError`` object is created. If an
635637error is detected during a bulk write operation, a `MongoBulkWriteException
636638<{+core-api+}/MongoBulkWriteException.html>`__ is thrown.
637639
@@ -643,7 +645,7 @@ Example
643645'''''''
644646
645647For example, the driver raises a ``MongoBulkWriteException`` if your bulk insert
646- contains two documents into a collection that violate the collection's schema
648+ contains two documents that violate the collection's schema
647649validation rules. Suppose the collection has a rule where the value of the
648650``quantity`` field must be an ``int`` type. If your bulk insert contains a
649651document with a ``quantity`` of ``"three"`` and another with a ``quantity`` of
@@ -674,11 +676,15 @@ document with a ``quantity`` of ``"three"`` and another with a ``quantity`` of
674676 com.mongodb.internal.connection.ProtocolHelper.getBulkWriteException(ProtocolHelper.java:254)
675677 ... 19 more
676678
677- This exception message contains a list of the two ``WriteError`` objects. The
678- description in the ``MongoBulkWriteException`` object is vague as
679- documents associated with the same bulk operation could produce different error
680- types. Refer to the individual ``WriteError`` objects' ``message`` fields to
681- determine the cause of each error.
679+
680+ In the preceding error message, the ``MongoBulkWriteException`` object provides
681+ a vague description of the error, as documents associated with the same bulk
682+ operation could produce different error types. Instead, refer to the
683+ ``WriteError`` objects' ``message`` fields to determine the cause of each error.
684+ Refer to the ``WriteError`` objects' ``details`` field for more specific
685+ information, such as the schema rules and the offending documents. To address
686+ this error, you must either revise the document to adhere to the schema
687+ validation rules or bypass validation.
682688
683689Additional Information
684690----------------------
0 commit comments