Reputation: 97
I have a production iOS app and I'm a little confused about the 100 object default query limit (which I just found out about). If I have a class that has 150 objects, and I query for 125 of those objects, will it only return 100 objects? Also, if I have a class that has 200 objects and I want to query for just 1 object, and that object is number 150 out of 200, will it return nothing because it only queried the first 100? Thanks for any help in advance.
Upvotes: 1
Views: 2300
Reputation: 2132
Parse queries have a default limit of 100 set on them. You can retrieve upto 1000 parseobjects in one query. You need to set the limit attribute when you execute the query. If you want to retrieve more than 1000 objects in one query, you need to split the query so that you can run it multiple times and get your whole result set in your app.
Also, if I have a class that has 200 objects and I want to query for just 1 object, and that object is number 150 out of 200, will it return nothing because it only queried the first 100?
If your query has only one result, it will be retrieved no matter where the data is in the table, meaning the query runs on the whole table. The limit applies only to the number of rows returned in a single query. Check the ios parse docs to understand the working better.
You can limit the number of results by setting limit. By default, results are limited to 100, but anything from 1 to 1000 is a valid limit:
query.limit = 10; // limit to at most 10 results
Upvotes: 2