Skip to content

Commit 86e62a7

Browse files
Remove incorrect info; share existing include; update include (#5748) (#5767)
* Remove incorrect info; share existing include; update include * remove extra, confusing, blurb * external review * Update source/includes/warning-document-duplicate-key-names-body.rst --------- Co-authored-by: Kevin Cherkauer <[email protected]>
1 parent 83a9bd7 commit 86e62a7

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

source/core/document.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,7 @@ names:
9191

9292
.. include:: /includes/fact-document-field-name-restrictions.rst
9393

94-
BSON documents may have more than one field with the same name.
95-
Most :driver:`MongoDB interfaces </>`, however, represent MongoDB
96-
with a structure (e.g. a hash table) that does not support duplicate
97-
field names. If you need to manipulate documents that have more than one
98-
field with the same name, see the :driver:`driver documentation
99-
</>` for your driver.
100-
101-
Some documents created by internal MongoDB processes may have duplicate
102-
fields, but *no* MongoDB process will *ever* add duplicate fields to an
103-
existing user document.
94+
.. include:: /includes/warning-document-duplicate-key-names-body.rst
10495

10596
Field Value Limit
10697
~~~~~~~~~~~~~~~~~
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
The MongoDB Query Language is undefined over documents with duplicate
2-
field names. BSON builders may support creating a BSON document with
3-
duplicate field names. While the BSON builder may not throw an error,
4-
inserting these documents into MongoDB is not supported *even if* the
5-
insert succeeds. For example, inserting a BSON document with duplicate
6-
field names through a MongoDB driver may result in the driver silently
7-
dropping the duplicate values prior to insertion.
8-
1+
The MongoDB Query Language does not support documents with duplicate
2+
field names. While some BSON builders may support creating a BSON document with
3+
duplicate field names, inserting these documents into MongoDB is not supported
4+
*even if* the insert succeeds, or appears to succeed. For example, inserting a
5+
BSON document with duplicate field names through a MongoDB driver may result in
6+
the driver silently dropping the duplicate values prior to insertion, or may
7+
result in an invalid document being inserted that contains duplicate fields. Querying against any such documents would lead to arbitrary and inconsistent results.

0 commit comments

Comments
 (0)