Based on the background of RDMBS, it is hard not to think of thinkgs as a union, especially when working with the MongoDB environment without a schema.
I read on the blog that DBRefs were only useful when you know the type of object you are referencing.
Why is this so? Of course, they have more benefit.
Say I have a custom collection and a collection of employers. Many users can link to the same employer. For me, this is the perfect use of DBRef. However, this is contrary to what I read on this blog.
Of course, I could integrate the employer into each user collection, but what happens when the employer changes? Maybe employers change address or phone number or something else. If the employer is embedded in each user, then I will have to update each embedded user document.
It may not be effective. Or maybe it?
source share