[DOCS-12504] Warn that documents with duplicate key names are not supported Created: 22/Feb/19  Updated: 30/Oct/23  Resolved: 10/Sep/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Bernie Hackett Assignee: Nathan Contino (Inactive)
Resolution: Fixed Votes: 1
Labels: docs-onboarding-candidate
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DRIVERS-612 Add documentation warning against the... Implementing
Participants:
Days since reply: 4 years, 22 weeks, 1 day ago
Epic Link: DOCSP-1769

 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.)



 Comments   
Comment by Githook User [ 10/Sep/19 ]

Author:

{'name': 'nathan-contino-mongo', 'username': 'nathan-contino-mongo', 'email': 'nathan.contino@mongodb.com'}

Message: DOCS-12504: duplicate key name warning
Branch: master
https://github.com/mongodb/docs/commit/6298d4de42767a43507d12030fb448d8dc6dd3ae

Generated at Thu Feb 08 08:05:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.