Hi there I maybe this question was answered before somewhere but i did not find it.
I want to create a structure for the product item and like that the translation content located in different collection and when i need it i just do lookup. Is it a right way or nested collection will be better?
Different collections example:
Product :
{
"_id": 1,
"price": 12,
}
Content :
[
{
pid: 1,
lang: "ru",
title: "Привет"
},
{
pid: 1,
lang: "en",
title: "Hello"
},
{
pid: 2,
lang: "ru",
title: "Пока"
},
{
pid: 2,
lang: "en",
title: "Bye"
}
]
Connection between through pid for content and _id of product item
Or nested will be better and it avoid using lookup ?
{
"_id": 1,
"price": 12,
"content": [
{
"lang": " en",
"title": "Hello"
},
..........
]
}