Skip to content

Commit cb0023a

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

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
@@ -151,6 +151,14 @@ Write Concerns and Transactions
151151

152152
.. |operation| replace:: :dbcommand:`insert`
153153

154+
Insert Inaccuracies
155+
~~~~~~~~~~~~~~~~~~~
156+
157+
.. include:: /includes/fact-insert-inaccuracies.rst
158+
159+
.. |writeResult| replace:: :data:`insert.n`
160+
161+
154162
Examples
155163
--------
156164

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)