Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested Include Parse.com

I have a UserToMessage table which has a pointer to user called thisUser and a pointer to message called msg

The message table has a pointer to user called creator. When I query UserToMessage I [includeKey:@"message"]

I also want to [includeKey:@"creator"] somehow...

like image 654
Apollo Avatar asked Nov 28 '25 16:11

Apollo


1 Answers

This will work.

PFQuery *query = [PFQuery queryWithClassName:@"UserToMessage"];
[query includeKey:@"msg"];
[query includeKey:@"msg.creator"];

// Add constraints on query
...
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if(error) return;
    // Do action
    ...
}];
like image 98
Fury Avatar answered Dec 02 '25 05:12

Fury