I’m a newbie to MongoDB and could use some help with my db.
I want to build a db that stores product data. A product has a lot of attributes that I want to embed in the product itself. Additionally a product can be purchased in 1-n markets and is assigned to 1 category.
In the app the user has a category list and once he selects a category all products of the category are listed in a grid. He also has the possibility to filter the products to see in which markets they’re available.
I watched some tutorials and I believe it’s best to have three collections (products, markets, categories), since there are cases in the app where I would query products, markets and categories independently.
In each category and each market I’d store the id’s of all assigned products in an array. In the product itself I’ll have an array with the related market id’s and an attribute with the category id.
Does this sound right to you or do you have any suggestions for improvement.
Any help is much appreciated.