I have Inventory table in my Parse database with two relevant fields: productId and quantity. When a shipment is received, a record is created containing the productId and quantity. Similarly, when a sale occurs, an inventory record is made with the productId and quantity (which will be negative, since the inventory will decrease after the sale).
I would like to run a group by/ sum aggregate query on the Inventory table with Parse Cloud Code that outputs a dictionary containing unique productIds as the keys and the sum of the quantity column for those Ids as the values.
I have seen a number of old posts saying that Parse does not do this, but then more recent posts refer to Cloud Code such as averageStart in the Cloud Code Guide: https://parse.com/docs/cloud_code_guide
However, it seems that Parse.Query used in averageStars has a maximum limit of 1000 records. Thus, when I sum the quantity column, I am only doing so on 1000 records rather than the whole table. Is there a way that I can compute the group by/ sum across all the records in the inventory table?
For example:
Inventory Table
productId quantity
Record 1: AAAAA 50
Record 2: BBBBB 40
Record 3: AAAAA -5
Record 4: BBBBB -2
Record 5: AAAAA 10
Record 6: AAAAA -7
Output dictionary: {AAAAA: 48, BBBBB: 38}