how to search values in a dictionary that is assigned to a key for a PFObject without downloading all PFObjects of that class (iOS/Parse)
- by mkc842
Suppose I have a set of PFObjects (essentially dictionaries) of class "myObject". Objects of this class contain for key "myDictionary" a dictionary. "myDictionary", in turn, has a key "myKey" that I want to access and search for matches against "mySearchTerm". I don't want to download all myObject objects and then iterate through them to check myKey in each, because that would be very inefficient. I want to use a findObjects message to return just the matches.
Is such a query possible? In other words, how can I search the values in a dictionary that is assigned to a key for a PFObject without downloading all PFObjects of that class?
Here's what it might look like if there were a simple method for it, but I made up the containsKey part to clarify what I am contemplating:
PFQuery *objectQuery = [PFQuery queryWithClassName:@"myObject"];
[objectQuery whereKey:@"myDictionary" ~containsKey~:@"myKey" equalTo:"mySearchTerm"];