I have a MongoDB schema design that embeds a duplicate subdocument (same ObjectId as well) in different documents of the same collection:
Document looks like:
{"inbox":
{ "_id": ...,
"conversations": [
{"_id": ...,
"messages": [{"_id": ...,
"body": ...}]
]
}
}
In the inbox collection whenever two people have a conversation I push a duplicate of the conversation to both inboxes.
My plan was to keep reads of the inbox simple and allow a multi document update to write a message to all the conversations with same conversation id. It seems to work as expected, but am I missing a downside to allowing duplicate subdocument ObjectId's across different documents within a collection?