Parse只检索100个项目,我有108个

时间:2015-08-20 07:42:48

标签: ios parse-platform

我遇到了问题。昨天我的数据库超过了100个项目。在我的应用程序中,我正在执行我的查询:

PFQuery *languageQuery = [PFQuery queryWithClassName:@"Language"];
[languageQuery whereKey:@"code" equalTo:_languageCode];

PFQuery *query = [PFQuery queryWithClassName:@"DrinksLocal"];
[query whereKey:@"language" matchesQuery:languageQuery];

[query includeKey:@"country"];
[query includeKey:@"types"];
[query includeKey:@"drinks"];
[query includeKey:@"matching"];

[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    if (!error) {
    // do some stuff
    } else {
        DDLogError(@"Error: %@ %@", error, [error userInfo]);
    }
}];

我该如何解决这个问题?我以为解析在后台做了分页,所以你没有这个问题?

将限制设置为1000是一种临时解决方案。我怎样才能真正解决1000多件物品?

1 个答案:

答案 0 :(得分:2)

您必须为超过100个项目的查询设置限制。检查文档Here

query.limit = 10; // limit to at most 10 results

对于超过1K行,您必须遵循分页 - 检查herehere