Hierarchical Relationships
D
David Barratt
For content types like Comments, Menus, or anything with a hierarchy (or a tree), it would be useful to have a field that allows you to specify the
parent
entry.Behind the scenes, Strapi could use a Closure Table (https://dirtsimple.org/2010/11/simplest-way-to-do-tree-based-queries.html) to make querying the entire tree fast.
j
jacek
Is it possible you can already do that with a relation field that points to same type? I use a relation field in article type to add related articles, but it could be used to get a parent. And you can write a simple endpoint in the controller that adds the whole tree to the response.