I'm building a food delivery app using AngularJS and using Parse.com as my BaaS.
After a user constructs their orders, they pay for the order and the order is then saved to Parse.com.
Since the maximum array size on Parse.com for an array column is 128KB, I kept the representation of the order as simple as possible. I have an array column for items. To identify each element in the items array, I only keep the objectId and the quantity.
Another concern of mine is to minimize Parse.com queries given that bandwidth is metered.
- for each Order
- for each Order Item
- for each Menu Item
- if Order Item ID == Menu Item ID, copy Menu Item data.
I'm hard pressed to believe there is not a simpler way to do it. But most of the documentation I've seen doesn't say much about retrieving a subset of a collection by objectIds.
I believe this is the relevant page of documentation:
https://parse.com/docs/js/api/classes/Parse.Query.html
Does anyone have any insight as to what would be the best approach to solving this problem without breaking this up into multiple Parse.com queries?
EDIT: If you need to see the code, sure. It works. I just know from an algorithmic standpoint, this is totally inefficient.