There is an online store of goods, it is necessary to implement on mongo. Structure Directory, Subdirectory and Last Level Item. How to make Mongo?
Divide into 3 collections (catalogs, subdirectories and goods)
Or
catalog : { 1 : { id: 1, name: "Товары для дома", subcatalog: { id: 1 name: "Светильники, products: { 1: { name: "Товар 1", properies: { } } } }, subcatalog: { id: 2 name: "Пылесосы, products: { 1: { name: "Товар 1", properies: { } } } }, }, 2 : { id: 1, name: "Товары для сада", subcatalog: { id: 1 name: "Лопаты, products: { 1: { name: "Товар 1", properies: { } } } }, subcatalog: { id: 2 name: "Совки, products: { 1: { name: "Товар 1", properies: { } } } }, } }
How generally right?