Skip to content

Commit efe1637

Browse files
authored
(DOCS-11076): Document inaccuracies when inserting documents (#2149) (#2184)
* add information about insert inaccuracies * copy review feedback * tech review feedback
1 parent a770ef5 commit efe1637

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Even if you encounter a server error during an insert, some documents
2+
may have been inserted.
3+
4+
After a successful insert, the system returns |writeResult|, the number
5+
of documents inserted into the collection. If the insert
6+
operation is interrupted by a replica set state change,
7+
the system may continue inserting documents. As a result,
8+
|writeResult| may report fewer documents than actually inserted.

source/reference/command/insert.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ Write Concerns and Transactions
132132

133133
.. |operation| replace:: :dbcommand:`insert`
134134

135+
Insert Inaccuracies
136+
~~~~~~~~~~~~~~~~~~~
137+
138+
.. include:: /includes/fact-insert-inaccuracies.rst
139+
140+
.. |writeResult| replace:: :data:`insert.n`
141+
142+
135143
Examples
136144
--------
137145

source/reference/method/Bulk.insert.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ Description
3939
- Document to insert. The size of the document must be less than or
4040
equal to the :limit:`maximum BSON document size <BSON Document Size>`.
4141

42-
43-
42+
Behavior
43+
--------
44+
45+
Insert Inaccuracies
46+
~~~~~~~~~~~~~~~~~~~
47+
48+
.. include:: /includes/fact-insert-inaccuracies.rst
4449

50+
.. |writeResult| replace:: :data:`BulkWriteResult.nInserted`
4551

4652
Example
4753
-------

0 commit comments

Comments
 (0)