Answer the question
In order to leave comments, you need to log in
How to build a hierarchy in MongoDB?
There is a table. There are employees in it, and each employee has an ID, and there is an ID of the manager.
I need to build a hierarchy, or group them in such a way that I understand whether a particular subordinate is a subordinate of the leader in the hierarchy.
Conditionally:
[
{emp: 1, leader: 2},
{emp:2, leader:5},
{emp:5, leader: 10}
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question