Skip to content

Commit 0bead5f

Browse files
committed
DOCSP-30350 Adding descriptions and editing
1 parent d4c425f commit 0bead5f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

source/crud/bulk.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ Even though the write operation inserting a document with a duplicate key result
623623
in an error, the other operations are executed because the write operation is
624624
unordered.
625625

626+
.. _java-bulk-insert-troubleshooting:
627+
626628
Troubleshooting
627629
---------------
628630

@@ -631,7 +633,7 @@ Troubleshooting
631633
Bulk 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
635637
error is detected during a bulk write operation, a `MongoBulkWriteException
636638
<{+core-api+}/MongoBulkWriteException.html>`__ is thrown.
637639

@@ -643,7 +645,7 @@ Example
643645
'''''''
644646

645647
For 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
647649
validation 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
649651
document 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

683689
Additional Information
684690
----------------------

source/crud/insert.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ operation and an insert many operation:
189189
insertOne() document id: BsonObjectId{value=...}
190190
insertMany() document ids: {0=BsonObjectId{value=...}, 1=BsonObjectId{value=...}}
191191

192+
.. _java-insert-troubleshooting:
193+
192194
Troubleshooting
193195
---------------
194196

@@ -197,7 +199,7 @@ Troubleshooting
197199
Write Exception
198200
~~~~~~~~~~~~~~~
199201

200-
The driver creates write exceptions when a ``WriteError`` object is created. The
202+
The driver creates a write exception when a ``WriteError`` object is created. The
201203
driver raises a `MongoWriteException <{+core-api+}/MongoWriteException.html>`__
202204
for any write errors that occur when performing single write operations.
203205

source/includes/crud/write-error.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.. _java_write_error:
22

3-
This section describes write exceptions you might encounter when
4-
using the {+driver-long+} to perform MongoDB write operations. Once you
5-
understand the types of write exceptions that the driver raises, you can take
6-
appropriate actions to either handle them or correct the error-causing code.
3+
This section explains write exceptions you might encounter when using the
4+
{+driver-long+} to perform MongoDB write operations. Once you learn how to
5+
understand the write exceptions that the driver raises, you can take appropriate
6+
actions to either handle them or correct the error-causing code.
77

88
.. note::
99

10-
This page addresses only write exception handling. If you encounter
10+
This section addresses only write exception handling. If you encounter
1111
any other issues with MongoDB or the driver, visit the following
1212
resources:
1313

0 commit comments

Comments
 (0)