.Net Core mongodb database structure question
I generally have a question about the database structure for mongodb and how to use it properly, I know there is no left join and such which makes me brainstorm how to use it properly with these missing things, if one could answer the next question that'd be great, let's imagine I have the following tables in MsSQL (Products, Invoices, Organisations, InvoiceLines) we can create new products, organisations and use them in InvoiceLines to show the customer his invoice with the products he ordered for/from x company, now the question is, how would you want to handle a "left join" in mongodb, copy the data over from Products/Organisations to the BSON document and keep it all together but the problem here is that if I would want to change an product/organisation name it wouldn't change in the BSON document since we "copied" the data or is it better to store a list of ID's of Products ad Organisations in the BSON document and manually grab the products/organisations when we need it but the problem I see yet again is that there is no left join, so instead of simply doing 1 query I'm going to be doing let's say a 100 mongodb queries since I have a 100 products in my Invoice
tl;dr what is the best way for mongodb to handle left joins in C#, copy the data or use ID's
0 comments:
Post a Comment