We want to design mongodb such that it can store data in multiple language.
We want to store person's info like name, gender, city, state, etc in english as well in arabic.
What is the best way to do so?
We want to design mongodb such that it can store data in multiple language.
We want to store person's info like name, gender, city, state, etc in english as well in arabic.
What is the best way to do so?
It's very dependent on your usage of the data, If you're going to be using both language at the same time I'd store that all in one document per person.
person = {
englishName : "English Name",
arabicName : "Arabic Name",
address: {
city: "city",
...
}
}
However you could store it in separate documents but in the same collection:
person = {
culture: "en"
name : "English Name",
address: {
city: "city",
...
}
}
person = {
culture: "ar"
name : "Arabic Name",
address: {
city: "city",
...
}
As I said it very dependant on how your application is going to work, but try to limit cross document joins.