P
P
Pantene7422018-11-08 11:34:58
MongoDB
Pantene742, 2018-11-08 11:34:58

What is the best way to store nested categories with multi-level nesting in MongoDB?

Once upon a time, when I was working with the LAMP stack, I made a table in Mysql where I wrote down IDs in the category of her children. And there was a field to indicate that the category is the root (entrance to the recursion). And recursion brought it all out .
With such an idea, mongoDB was laughed at. What's the best way to do this in Mongo... Do nested arrays in one record ? But I have no idea how to make requests later ... it seems that it is possible to work adequately only with two-level nesting

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pantene742, 2018-11-09
@Pantene742

https://docs.mongodb.com/manual/tutorial/model-tre...
Here is a good link for those who will be interested in this question...
Do not read the comments and answers above, they do not correspond to the question...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question