Is there a way to query by array length in Parse? i.e. I want to get all the objects where the array length > 2 or something like that.
Thanks!
Is there a way to query by array length in Parse? i.e. I want to get all the objects where the array length > 2 or something like that.
Thanks!
There is no direct way to do that. But what you could do is, adding another row which you use as a counter. Check the beforeSave documentation for that. For example everytime you add elements to the array, you increase the counter. Than you could check the size like that:
//Shows all items where the arraySize is bigger than 10
yourQuery.whereKey("arraySize", greaterThan: 10)