[SERVER-48998] Getting "Unexpected error" instead of "Duplicate key error" while trying to insert or update duplicate value in Array(of objects) > Field Created: 21/Jun/20  Updated: 06/Dec/22  Resolved: 23/Jun/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 4.2.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Arpan Bag Assignee: Backlog - Triage Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Capture-2.PNG     PNG File Capture1.5-2.PNG     PNG File Capture2-2.PNG     PNG File Capture3-3.PNG     PNG File Capture4-1.PNG     PNG File Capture5-1.PNG     PNG File Capture6-1.PNG     PNG File Capture7.PNG     PNG File Capture8.PNG     PNG File Capture9.PNG    
Assigned Teams:
Server Triage
Operating System: ALL
Steps To Reproduce:
  1. Create a document with array of objects, say "children", and those array element objects having a field, say "childId".
    Eg:

    {
     "children": [{
     "childId": "child1"
     }, {
     "childId": "child2"
     }]
    }
    

  2. Create an unique index on children>childId
  3. Create another document with same data, but different childId values.
    Eg:

    {
     "children": [{
     "childId": "child3"
     }, {
     "childId": "child4"
     }]
    }
    

  4. In Mongodb Atlas web, clone the document to create a new document with same details. You'll get an error: "Unexpected error"
  5. In Mongodb compass, object view ( {} ), try doing the same, will get issue most of the times, the screen goes blank!
  6. In Mongodb compass, list view, try doing the same, it works as expected most of the times.
  7. If cloning works, without any error, do the following: update the second document to add another object to "children" array with "childId": "child1" (to be a duplicate of childId of an element of first document). You'll get the error.
Participants:

 Description   

Getting "Unexpected error" instead of "Duplicate key error" while trying to insert or update duplicate value in Array(of objects) > Field



 Comments   
Comment by Carl Champain (Inactive) [ 23/Jun/20 ]

Hi arpanbag1996@gmail.com,

The SERVER project is for bugs and feature suggestions for the MongoDB server. To inform our Atlas team of issues you are having or feature requests you'd like to suggest, please reach out to the Atlas support team via Intercom. You can do this by clicking the round green button at the bottom right of the cluster view page in Atlas. I will now close this ticket.

Kind regards,
Carl
 

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