I have started exploring this mixin. I would like to have following capability. Please advice how this can be achieved.
For example. I created hierarchy of catagories for books say
Young Adult --> Action --> Adventure --> Fiction
Young Adult --> Action --> Adventure --> Real Life --> Mythological
Each node is a Model called category.
Each category has following relationship
Category --> Has Many --> Books
Book --> belongs to --> one category (for simplicity)
Note. books may belong to root node, parent node. Not just leaf nodes.
I can select any particular category and get list of books.
What I would like to do is, get list of all books for each category in one go.
The API asTree/AllTree should get me a tree of categories and embed in each category document, list of associated books by using 'Include' . This I want to achieve using single API as in my business use case, hierarchy of categories and corresponding items is small and finite. Hence I want to build an optimized way to query the data to provide better user experience by fetching all the items in advance.
The allTree API takes parameter which seems to apply Filter defining fields, where, include, order, offset, and limit ONLY ON roots node.
CAN THIS BE MODIFIED TO APPLY THE FILTERS ON CHILD NODES AS WELL?
Particulary Scope {Include, where"} ??
Hi
I have started exploring this mixin. I would like to have following capability. Please advice how this can be achieved.
For example. I created hierarchy of catagories for books say Young Adult --> Action --> Adventure --> Fiction Young Adult --> Action --> Adventure --> Real Life --> Mythological
Each node is a Model called category. Each category has following relationship Category --> Has Many --> Books Book --> belongs to --> one category (for simplicity)
Note. books may belong to root node, parent node. Not just leaf nodes.
I can select any particular category and get list of books.
What I would like to do is, get list of all books for each category in one go.
The API asTree/AllTree should get me a tree of categories and embed in each category document, list of associated books by using 'Include' . This I want to achieve using single API as in my business use case, hierarchy of categories and corresponding items is small and finite. Hence I want to build an optimized way to query the data to provide better user experience by fetching all the items in advance.
The allTree API takes parameter which seems to apply Filter defining fields, where, include, order, offset, and limit ONLY ON roots node.
CAN THIS BE MODIFIED TO APPLY THE FILTERS ON CHILD NODES AS WELL? Particulary Scope {Include, where"} ??
Regards