Hi,
I have posted the same question a while ago here but it didn’t lead to any results so this is a new version with everything I learned so far.
I have a database of cities and temples. Each city has multiple temples associated with it which themselves have multiple items associated with them through a relation. The items (called “Goshuin”) are in a third table.
I’m trying to display a list of cities and with each city the amount of temples and the sum of all Goshuin in those temples.
For example:
“Nara” - 8 temples - 14 Goshuin
I’ve gotten as far as this request:
https://optimallanguage.backendless.app/api/data/City?loadRelations=Temples.Goshuin&property=Name&property=Temples&property=count(Temples)as%20TempleCount&property=count(Temples.Goshuin)as%20GoshuinCount&groupBy=objectId
It gives me all the info I need including a count of the temples as well as the Goshuiin. However, the count is incorrect. To use the example from earlier, Nara should have 8 temples but the count function returns 45.
Any pointers are appreciated and feel free to ask me to clarify.
Thank you for your time.