Hello,
I’m writing an API service to retrieve a row from TableA which has a “routes” column with 1toN relations to TableB which has an “offers” column with 1toN relations to TableC. Using two-step method.
I am trying to retrieve one TableA record containing all of its TableB and TableC descendants. Sadly, for each TableA row, there are about 103 TableB rows. So I am using LoadRelationsQueryBuilder in a loop to get the relations in 100 row chunks. No problem. However, I have not been able to get the TableC relations to show up under any circumstances, in two calls. I have played with calling loadRelations with a greater query depth, and using setRelated with both [“routes”], and [“routes.offers”], but no TableC offers are ever returned. This already an expensive operation, do I need to make 3 calls to get all the relationships, or am I just doing it incorrectly? In a nutshell, I am doing:
let lrqb = Backendless.LoadRelationsQueryBuilder.create()
lrqb.setRelationName("routes")
lrqb.setPageSize(100)
lrqb.setRelationsDepth(2)
lrqb.setRelated(["offers"]) // or ["routes.offers"]
const items = await Backendless.Data.of("TableA").loadRelations(tableAId, lrqb)
Thank you, Kelly