我在Parse.com上有一个类,它有一个x和y字段。是否可以使用一个查询来获取x = 10
和x = 20
以及y = 10
和y = 20
中所说的所有对象?
查询是否会像这样设置?
PFQuery *query1 = [PFQuery queryWithClassName:@"myClass"];
[query1 whereKey:@"x" greaterThanOrEqualTo:[NSNumber numberWithInt:leftEdge]];
[query1 whereKey:@"x" lessThanOrEqualTo:[NSNumber numberWithInt:rightEdge]];
PFQuery *query2 = [PFQuery queryWithClassName:@"myClass"];
[query1 whereKey:@"y" greaterThanOrEqualTo:[NSNumber numberWithInt:topEdge]];
[query1 whereKey:@"y" lessThanOrEqualTo:[NSNumber numberWithInt:bottomEdge]];
PFQuery *query = [PFQuery orQueryWithSubqueries:@[query1, query2]];