Skip to content

Commit fcbf8cd

Browse files
Remove incorrect info; share existing include; update include (#5748)
* 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]> --------- Co-authored-by: Kevin Cherkauer <[email protected]>
1 parent c9504b7 commit fcbf8cd

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
@@ -94,16 +94,7 @@ names:
9494

9595
.. include:: /includes/fact-document-field-name-restrictions.rst
9696

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

10899
Field Value Limit
109100
~~~~~~~~~~~~~~~~~
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)