My parse DB has 4 models:
- User
- League
- Game
- GameEvent
User has many leagues. League has many games. Game has many gameEvents.
Table structure:
League
Game
GameEvent
I managed to fetch all the GameEvents of a given league and filter them by:
- Type = 7 (type = goal)
- createdAt between the dates the user enters
However, this is not the data I need as I want to find how many goals every player scored in this league between the given dates. (player name is stored as a string in the title field of the GameEvent model). Basically, I need an SQL style "GROUP BY" query in order to get the count, but "GRUOP BY" is not supported by Parse.
I considered using Parse "cloud coding" with an after_save event, but it won't work because the createdAt range is dynamic.
Is there a way to do it without counting the results in the app itself?
0 comments:
Post a Comment