| Steps To Reproduce: |
- 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"
|
}]
|
}
|
- Create an unique index on children>childId
- Create another document with same data, but different childId values.
Eg:
{
|
"children": [{
|
"childId": "child3"
|
}, {
|
"childId": "child4"
|
}]
|
}
|
- In Mongodb Atlas web, clone the document to create a new document with same details. You'll get an error: "Unexpected error"
- In Mongodb compass, object view ( {} ), try doing the same, will get issue most of the times, the screen goes blank!
- In Mongodb compass, list view, try doing the same, it works as expected most of the times.
- 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.
|