https://mongodb.prakticum-team.ru/basics/embedded-mongodb
https://mongodb.prakticum-team.ru/blog/post/building-with-patterns-the-extended-reference-pattern
I’m creating a data model where performant reads, and consistent data across references take precedence over writes.
What are best practices for CRUD update operations on a document field, and all documents that reference that document and also stores some of the associated information?
Example:
Collection A
{
_id: 123,
title: "Document title",
body: "Lorem ipsum dolor sit amet..."
}
Collection B
{
_id: 456,
name: "Another document 01",
collectionA: {
_id: 123,
title: "Document title"
}
}
Collection C
{
_id: 789,
name: "Another document 02",
collectionA: {
_id: 123,
title: "Document title"
}
}
Collection A UPDATED
{
_id: 123,
title: "New Document title added!",
body: "Lorem ipsum dolor sit amet..."
}