I have a series of objects that each reference a parent object, and am trying to look up everything with one API call using transactions.
The data structure is as follows:
Book (top-level object)
Section (contains reference to the parent Book)
Chapter (contains reference to parent Section)
Subchapter (contains reference to parent Chapter)
Currently, the way we load the table of contents for a book is as follows:
Load all sections with book.objectId=the book Id we want
Load all chapters with section.objectId IN (result from previous step)
Load all subchapters with chapter.objectId IN (result from previous step)
This is not an ideal solution since it requires three API calls that have to be done in sequence to load the table of contents, and I was looking into the use of transactions or some alternate way to load the entire table of contents in one operation without any success so far. Is this even possible, and if so how would I go about doing it?