I have the following query:
PFObject *photoData = [PFObject objectWithClassName:@"Photos"];
PFRelation *relation = [photoData relationForKey:@"photo"];
PFQuery *query = [PFQuery queryWithClassName:@"People"];
query = [relation query];
[query whereKey:@"deleted" equalTo:@NO];
[query whereKey:@"createdAt" lessThan:_createdAt];
[query orderByDescending:@"createdAt"];
query.limit = 20;
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
...
}
I have a database table in Parse called People. In that table, there is a bunch of data but has a relation called photo. Now, I am saving one photo (with its data) in the photo relation. In the Parse dashboard, the data is saved correctly.
How do I fetch that back? Right now I have constraints on this system (and question) that each People objects has ONLY one photo object. So I need to fetch it all back at once.