Good night, guys.
As MongoDB changes a lot of our way of modeling a database, I came across a question that may be half-beast.
I'm doing a Restful API using Lumen and MongoDB as a database, and I want to create a collection of product categories, and these categories have their respective mums and daughters categories. As in the example below:
- parent category
- child category
- daughter category
- child category
- child category
- child category
- parent category
- child category
- child category
- child category
What would be the most correct way to lay out this in one collection? Or would the correct way be, somehow, put these categories within the product collection?