We are facing a problem reading data from relational tables. We have table1 ,which has in one of its columns a pointer to another table , called table2 . We need to get the data in table2 , from table1's pointer in one query request .
So, the query right now is :
PFQuery *query = [PFQuery queryWithClassName:@"table1"];
[query whereKey:@"completed" equalTo:[NSNumber numberWithBool:NO]];
[query whereKey:@"userId" equalTo:[PFObject objectWithoutDataWithClassName:@"Users" objectId:@"someID"]];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
if (!error)
{
//new user
if(objects.count==0)
{
}
else
{
//here we get "Users:vAJS2T96V1" ,which is the pointer to table2 ,but we need to go deeper to the other table
// in the same query, and get the data from table2 .
}
}
}];
How do we get the data from table2, in one query ?