I am looking at modelling some data in MongoDB. Say for example a product has a supplier , and I want to embed the supplier name in the product
{
sku: 'prd1',
name: 'Product one',
supplier: {
supplierId: '5a37112f70467f45ec871e5b'
code: 'sup01',
name: 'Supplier One'
}
}
supplierId = the object id of the record in the supplier collection.
The supplier name would very rarely , if ever be updated. But if it does update , I need to be able to update all the embedded names in where that supplier is in a product.
I'm not overly familiar with Firebase , but it seems ( Reading This Blog Post ) that there is a mechamism called "multi-path updates" which solves this problem. Is there something similar in MongoDB , or do I need to manually keep track of all places the data exists and write my own code to update it?