Parent/User Relationship using Join type

I have list of users and there is one field called parent, some users might not have parents.

I want to get the full parent hierarchy, full child hierarchy for given user id.

What should by my mapping on that?

Here is the example.
UserId, Name, ParentId
1 . , KP . , NULL/Blank/0
2 . , RT . , 1
3 . , TH . , 2
4 . , MS , 3

If I want to get all child hierarchy of UserId-2 that should be Ids (3,4,....) and i also want to get the Parent hierarchy of 4 that should be (3,2,1...!).

Is it possible to achieve this in ES6.3? If yes, what should be my Mapping? I might have Single/Multiple Parents.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.