[SERVER-30393] MongoDB is accepting duplicate elements within the same level Created: 28/Jul/17 Updated: 31/Jul/17 Resolved: 28/Jul/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Basel Yousef | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | Create a list in R and try to append it to itself then insert the record into Mongo |
||||||||
| Participants: | |||||||||
| Description |
|
MongoDB is found to accept duplicate elements within the same level inside a document. The severity of this issue is that Mongodb didn't complain about it at all. However, when trying to query it using C# driver and looping through the code generates an error complaining about a duplicate element. When trying to view the document using Mongo Shell you can't see the duplicate either and you just see one element. So basically you have duplicate inside your documents but you can't see it and you are not aware of it until you interrogate it using C# driver. I hope this explains it, and I'm happy to answer any questions. |
| Comments |
| Comment by Kelsey Schubert [ 31/Jul/17 ] |
|
Hi yousefbasel, Since this is an ongoing open issue, the specific version that is does not indicate that this issue is unique. MongoDB currently relies on the client/driver to provide documents that do not contain duplicate fields at the same level. JSON standards do not specify the correct behavior when there are duplicate fields, and consequently recommend that users ensure field names are unique. For more details, see https://tools.ietf.org/html/rfc7159#section-4 and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf As a result of this ambiguity, different drivers may behave behave differently and allow the insertion of duplicate field names at the same level. SERVER-6439 moves the responsibility to the MongoDB Server from the client/drivers to ensure that the documents contain only unique field names. Hope this helps to clarify, |
| Comment by Basel Yousef [ 31/Jul/17 ] |
|
Thanks for your reply [Roman Fernandez] I hope this makes sense, please let me know if you need more information. Thanks, |
| Comment by Ramon Fernandez Marina [ 28/Jul/17 ] |
|
Thanks for your report yousefbasel; there's an existing ticket (SERVER-6439) to address this behavior, so I'm going to close this ticket as a duplicate. Feel free to vote for SERVER-6439 and watch it for updates. Thanks, |