I am trying to model my objects on MonogoDB and not sure how to proceed. I am building a Product catalog that will be:
- No frequent changes to product catalog. A bulk operation may be done weekly / fortnight.
- Product information is in multiple languages ( English, Spanish , French ) new language may be added anytime.
Here is what I am trying to do: I need to model my product catalog to capture the multilingual functionality. Assume I have:
product : {
_id:xxx,
sku:"23456",
name:"Name",
description: "Product details",
tags:["x1","x2"]}...
}
Surely, name,description, tags and possible images will change according to language. So, how do I model it?
- I can have a seperate collection for each language eg: enProducts,esProducts etc
Have JSON representation in the product itself with the individual languages like:
product :{ id: xxx, en: { name: "Name", description: "product details.." }, es: { name: "Name", description: "product details.." }, ... }
Or is there any other solution? Need help of MongoDB modeling experts here :)
this way will be the best:
just because you have to search for only one product and after you could choose any language.