We have a structure in db
with an id, INFO, fatherID, level
I have to given an ID, have to reconstruct all the Hierarchical Structure under the Given ID
The Structure is a Three
/------------ID1------------\
ID2[fatherID:ID1] ID3[fatherID:ID1]
ID4[fatherID:ID2] -/ \- ID5[fatherID:ID2] ID6[fatherID:ID3]-/ \-ID7[fatherID:ID3]
Given an ID i have to reconstruct all the hierarchy under the given id,
For Example given ID1 that is the root, i have to list ID1, ID2, ID3, ID4, ID5, ID6
Another Example is, given ID3 i have to list ID3, ID6, ID7
I'm trying to do it with a reduce() with recursion, but without success
Discussion posts and replies are publicly visible
Reduce() does no recursion.
I wrote a blog post on how to do this: appian.rocks/.../
Hi stefan you are even precious i user your post to resolve a hyerarchical path problem. With same structure starting from a bottone leaf level i finded the path from leaf to roof... but this time the approch have to be Top Down and not bottom up. Do you think that the article can be even useful
Yes I do.