Skip to content

Commit 1aa3a12

Browse files
authored
DOCS-12093 insertMany ordered:true behavior (#2784)
* DOCS-12093 insertMany ordered:true behavior * internal review
1 parent 83a7159 commit 1aa3a12

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

source/includes/fact-bulkwrite-operation-batches.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
The number of operations in each group cannot exceed the value of
22
the :limit:`maxWriteBatchSize <Write Command Batch Limit Size>` of
3-
the database. As of MongoDB 3.6, this value is ``100,000``.
4-
This value is shown in the :data:`hello.maxWriteBatchSize` field.
3+
the database. The default value of ``maxWriteBatchSize`` is
4+
``100,000``. This value is shown in the
5+
:data:`hello.maxWriteBatchSize` field.
56

67
This limit prevents issues with oversized error messages. If a group
78
exceeds this :limit:`limit <Write Command Batch Limit Size>`,
@@ -18,10 +19,10 @@ less than or equal to the value of the limit. For example, with the
1819
(for example, when writing a driver), MongoDB throws an error when
1920
attempting to execute a write batch which exceeds the limit.
2021

21-
Starting in MongoDB 3.6, once the error report for a single batch grows
22-
too large, MongoDB truncates all remaining error messages to the empty
23-
string. Currently, begins once there are at least 2 error messages with
24-
total size greater than ``1MB``.
22+
If the error report for a single batch grows too large, MongoDB
23+
truncates all remaining error messages to the empty string. If there
24+
are at least two error messages with total size greater than ``1MB``,
25+
they are trucated.
2526

2627
The sizes and grouping mechanics are internal performance details and
2728
are subject to change in future versions.

source/reference/method/db.collection.insertMany.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,15 @@ inserts each document in the array into the collection.
9595
Execution of Operations
9696
~~~~~~~~~~~~~~~~~~~~~~~
9797

98-
By default documents are inserted in order.
98+
By default, documents are inserted in the order they are provided.
9999

100-
If ``ordered`` is set to false, documents are inserted in an unordered
101-
format and may be reordered by :binary:`~bin.mongod` to increase performance.
102-
Applications should not depend on ordering of inserts if using an unordered
100+
If ``ordered`` is set to ``true`` and an insert fails, the server does
101+
not continue inserting records.
102+
103+
If ``ordered`` is set to ``false`` and an insert fails, the server
104+
continues inserting records. Documents may be reordered by
105+
:binary:`~bin.mongod` to increase performance. Applications should not
106+
depend on ordering of inserts if using an unordered
103107
:method:`~db.collection.insertMany()`.
104108

105109
.. include:: /includes/fact-bulkwrite-operation-batches.rst

0 commit comments

Comments
 (0)