[SERVER-6439] Duplicate fields at the same level should not be allowed Created: 13/Jul/12  Updated: 11/Jan/23

Status: Backlog
Project: Core Server
Component/s: Stability, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Critical - P2
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 6
Labels: bson, platforms-re-triaged, query-44-grooming, update
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-30393 MongoDB is accepting duplicate elemen... Closed
is duplicated by SERVER-7070 Insertion of document with duplicate ... Closed
is duplicated by SERVER-41354 Resultset change with 2x $or clauses ... Closed
is duplicated by SERVER-42018 $expr operators are not implicitly AN... Closed
is duplicated by SERVER-22885 Unable to find some of filed in docum... Closed
Related
related to CSHARP-4040 Serialization ignores discriminator f... Backlog
related to SERVER-19642 createIndexes command allows duplicat... Closed
is related to SERVER-19361 Insert of document with duplicate _id... Closed
is related to SERVER-9637 Upsert with filters for a subdocument... Closed
is related to SERVER-17902 findAndModify returns document with d... Closed
is related to SERVER-36999 mongo shell doesn't support inserting... Closed
is related to SERVER-24048 Value missing in case of Duplicate Fi... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Major Change
Participants:
Case:

 Description   

Disallow writing new documents with duplicate field names at the same level, like:

{a:1, a:2}

In previous versions of mongodb, updates could be written to produce duplicate fields, but can no longer be as of 2.6.

For existing data, one should be able to replace the existing "bad" documents with "fixed" versions.

Note: Documents which already exist should still be replicated and migrated during system operations, but cannot be modified without "fixing" them.

Clients: Some client will error if they encounter duplicate field names in a document, like .net; in javascript and other languages one of the fields may be hidden or lost since the native storage is a map where keys (field names) are unique.



 Comments   
Comment by Basel Yousef [ 31/Jul/17 ]

I don't think that issue SERVER-30393 is a duplicate of this issue since the former was reported on a server running Mongo 3.2.9.
It only happens when inserting the record from R.

I hope this can be investigated further.

Thanks,
Basel

Generated at Thu Feb 08 03:11:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.