1

I'm having a problem. Yesterday my database exceeded 100 items. In my app I'm doing my query like:

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]);
    }
}];

How can I solve this? I thought parse did pagination in the background so you didn't have this problem?

Setting the limit to 1000 is a temporary solution. How can I really solve this for like 1000+ items?

user1007522
  • 7,858
  • 17
  • 69
  • 113

1 Answers1

2

You have to set limit for querying for more than 100 items. Check Docs Here

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

For more than 1K rows, you have to follow paging - Check here and here.

Community
  • 1
  • 1
Vintesh
  • 1,657
  • 1
  • 24
  • 31