Details
-
Task
-
Resolution: Fixed
-
Major - P3
-
None
Description
Description
Low level BSON helpers in some drivers (for example, the BSON writer in the Java driver) can be abused to create documents with duplicate key names. For example:
{'foo': 'bar',
|
'foo': 'bim',
|
'foo': 'bam'}
|
The BSON spec is silent on the issue of duplicate key names. The server's behavior when confronted with duplicate key names is undefined. Since drivers generally use a map to represent a BSON document, only one of the keys will survive decoding and reinsertion of such a document.
A good place to add this might be https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names but the text should really be a warning / call to action.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
Attachments
Issue Links
- is related to
-
DRIVERS-612 Add documentation warning against the use of duplicate key names
-
- Implementing
-