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)

Posted by mkc842 on Stack Overflow See other posts from Stack Overflow or by mkc842
Published on 2013-06-28T21:34:01Z Indexed on 2013/06/28 22:21 UTC
Read the original article Hit count: 266

Filed under:
|

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"];

© Stack Overflow or respective owner

Related posts about ios

Related posts about parse.com