Skip to content

Commit 865c464

Browse files
addisonElliottflovilmart
authored andcommitted
Remove query skip/limit/count constraints documentation (#464)
* Remove skip/limit limit doc from iOS Queries * Remove skip/limit limit doc from Performance * Remove limit maximum constraint doc * Alter language for Avoid Counting Objects section * Add comma to 1000, better readability * Remove skip/limit limit doc from Arduino Queries * Remove skip/limit limit doc from Android Queries * Remove skip/limit limit doc from DotNet Queries * Remove skip/limit limit doc from JS Queries * Remove skip/limit limit doc from PHP Queries * Remove skip/limit limit doc from REST Queries * Remove skip/limit limit doc from Unity Queries
1 parent f6a0968 commit 865c464

File tree

9 files changed

+32
-37
lines changed

9 files changed

+32
-37
lines changed

_includes/android/queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ query.whereNotEqualTo("playerName", "Michael Yabuti");
3939
query.whereGreaterThan("playerAge", 18);
4040
```
4141

42-
You can limit the number of results with `setLimit`. By default, results are limited to 100, but anything from 1 to 1000 is a valid limit:
42+
You can limit the number of results with `setLimit`. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
4343

4444
```java
4545
query.setLimit(10); // limit to at most 10 results
@@ -61,7 +61,7 @@ query.getFirstInBackground(new GetCallback<ParseObject>() {
6161
});
6262
```
6363

64-
You can skip the first results with `setSkip`. This can be useful for pagination:
64+
You can skip the first results with `setSkip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
6565

6666
```java
6767
query.setSkip(10); // skip the first 10 results
@@ -227,7 +227,7 @@ query.findInBackground(new FindCallback<ParseObject>() {
227227
});
228228
```
229229

230-
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `whereMatchesQuery`. Note that the default limit of 100 and maximum limit of 1000 apply to the inner query as well, so with large data sets you may need to construct queries carefully to get the desired behavior. In order to find comments for posts containing images, you can do:
230+
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `whereMatchesQuery`. In order to find comments for posts containing images, you can do:
231231

232232
```java
233233
ParseQuery<ParseObject> innerQuery = ParseQuery.getQuery("Post");
@@ -387,7 +387,7 @@ Query caching also works with ParseQuery helpers including `getFirst()` and `get
387387

388388
## Counting Objects
389389

390-
Caveat: Count queries are rate limited to a maximum of 160 requests per minute. They can also return inaccurate results for classes with more than 1,000 objects. Thus, it is preferable to architect your application to avoid this sort of count operation (by using counters, for example.)
390+
Note: In the old Parse hosted backend, count queries were rate limited to a maximum of 160 requests per minute. They also returned inaccurate results for classes with more than 1,000 objects. But, Parse Server has removed both constraints and can count objects well above 1,000.
391391

392392
If you just need to count how many objects match a query, but you do not need to retrieve all the objects that match, you can use `count` instead of `find`. For example, to count how many games have been played by a particular player:
393393

_includes/arduino/queries.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ query.whereEqualTo("leverDown", true);
3636
query.whereEqualTo("temperature", 100.0);
3737
```
3838

39-
You can limit the number of results by setting a limit. By default, results are limited to 100, but anything from 1 to 1000 is a valid limit:
39+
You can limit the number of results by setting a limit. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
4040

4141
```cpp
4242
query.setLimit(10);
4343
```
4444

45-
You can skip the first results by setting `skip`. This can be useful for pagination:
45+
You can skip the first results by setting `skip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
4646

4747
```cpp
4848
query.setSkip(10);

_includes/common/performance.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ Most of the use cases around using regular expressions involve implementing sear
694694

695695
Writing restrictive queries allows you to return only the data that the client needs. This is critical in a mobile environment were data usage can be limited and network connectivity unreliable. You also want your mobile app to appear responsive and this is directly affected by the objects you send back to the client. The [Querying section](#queries) shows the types of constraints you can add to your existing queries to limit the data returned. When adding constraints, you want to pay attention and design efficient queries.
696696

697-
You can limit the number of query results returned. The limit is 100 by default but anything from 1 to 1000 is a valid limit:
697+
You can use skip and limit to page through results and load the data as is needed. The query limit is 100 by default:
698698

699699
```javascript
700700
query.limit(10); // limit to at most 10 results
@@ -996,7 +996,7 @@ If later on, you need to modify the underlying data model, your client call can
996996

997997
## Avoid Count Operations
998998

999-
For classes with over 1,000 objects, count operations are limited by timeouts. Thus, it is preferable to architect your application to avoid this count operation.
999+
When counting objects frequently, instead consider storing a count variable in the database that is incremented each time an object is added. Then, the count can quickly be retrieved by simply retrieving the variable stored.
10001000

10011001
Suppose you are displaying movie information in your app and your data model consists of a Movie class and a Review class that contains a pointer to the corresponding movie. You might want to display the review count for each movie on the top-level navigation screen using a query like this:
10021002

@@ -1288,17 +1288,12 @@ There are some limits in place to ensure the API can provide the data you need i
12881288

12891289
**Queries**
12901290

1291-
* Queries return 100 objects by default. Use the `limit` parameter to change this, up to a value of 1,000.
1292-
* Queries can only return up to 1,000 objects in a single result set. This includes any resolved pointers. You can use `skip` and `limit` to page through results.
1293-
* The maximum value accepted by `skip` is 10,000. If you need to get more objects, we recommend sorting the results and then using a constraint on the sort column to filter out the first 10,000 results. You will then be able to continue paging through results starting from a `skip` value of 0. For example, you can sort your results by `createdAt ASC` and then filter out any objects older than the `createdAt` value of the 10,000th object when starting again from 0.
1294-
* Alternatively, you may use the `each()` method in the JavaScript SDK to page through all objects that match the query.
1291+
* Queries return 100 objects by default. Use the `limit` parameter to change this.
12951292
* Skips and limits can only be used on the outer query.
1296-
* You may increase the limit of a inner query to 1,000, but skip cannot be used to get more results past the first 1,000.
12971293
* Constraints that collide with each other will result in only one of the constraint being applied. An example of this would be two `equalTo` constraints over the same key with two different values, which contradicts itself (perhaps you're looking for 'contains').
12981294
* No geo-queries inside compound OR queries.
12991295
* Using `$exists: false` is not advised.
13001296
* The `each` query method in the JavaScript SDK cannot be used in conjunction with queries using geo-point constraints.
1301-
* A maximum of 500,000 objects will be scanned per query. If your constraints do not successfully limit the scope of the search, this can result in queries with incomplete results.
13021297
* A `containsAll` query constraint can only take up to 9 items in the comparison array.
13031298

13041299
**Push Notifications**

_includes/dotnet/queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var query = ParseObject.GetQuery("GameScore")
5656
.WhereGreaterThan("playerAge", 18);
5757
```
5858

59-
You can limit the number of results by calling `Limit`. By default, results are limited to 100, but anything from 1 to 1000 is a valid limit:
59+
You can limit the number of results by calling `Limit`. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
6060

6161
```cs
6262
query = query.Limit(10); // limit to at most 10 results
@@ -76,7 +76,7 @@ var query = ParseObject.GetQuery("GameScore")
7676
ParseObject obj = await query.FirstAsync();
7777
```
7878

79-
You can skip the first results by calling `Skip`. This can be useful for pagination:
79+
You can skip the first results by calling `Skip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
8080

8181
```cs
8282
query = query.Skip(10); // skip the first 10 results
@@ -285,7 +285,7 @@ var query = ParseObject.GetQuery("Comment")
285285
.WhereEqualTo("post", ParseObject.CreateWithoutData("Post", "1zEcyElZ80"));
286286
```
287287

288-
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `WhereMatchesQuery` or a `join` LINQ query. Note that the default limit of 100 and maximum limit of 1000 apply to the inner query as well, so with large data sets you may need to construct queries carefully to get the desired behavior. In order to find comments for posts with images, you can do:
288+
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `WhereMatchesQuery` or a `join` LINQ query. In order to find comments for posts with images, you can do:
289289

290290
```cs
291291
var imagePosts = from post in ParseObject.GetQuery("Post")
@@ -388,7 +388,7 @@ You can issue a query with multiple fields included by calling `Include` multipl
388388

389389
## Counting Objects
390390

391-
Caveat: Count queries are rate limited to a maximum of 160 requests per minute. They can also return inaccurate results for classes with more than 1,000 objects. Thus, it is preferable to architect your application to avoid this sort of count operation (by using counters, for example.)
391+
Note: In the old Parse hosted backend, count queries were rate limited to a maximum of 160 requests per minute. They also returned inaccurate results for classes with more than 1,000 objects. But, Parse Server has removed both constraints and can count objects well above 1,000.
392392

393393
If you just need to count how many objects match a query, but you do not need to retrieve the objects that match, you can use `CountAsync` instead of `FindAsync`. For example, to count how many games have been played by a particular player:
394394

_includes/ios/queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ let predicate = NSPredicate(format:"playerName != 'Michael Yabuti' AND playerAge
150150
let query = PFQuery(className: "GameScore", predicate: predicate)
151151
</code></pre>
152152

153-
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:
153+
You can limit the number of results by setting `limit`. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
154154

155155
<pre><code class="objectivec">
156156
query.limit = 10; // limit to at most 10 results
@@ -187,7 +187,7 @@ query.getFirstObjectInBackgroundWithBlock {
187187
}
188188
</code></pre>
189189

190-
You can skip the first results by setting `skip`. This can be useful for pagination:
190+
You can skip the first results by setting `skip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
191191

192192
<pre><code class="objectivec">
193193
query.skip = 10; // skip the first 10 results
@@ -570,7 +570,7 @@ query.whereKey("post", equalTo: PFObject(withoutDataWithClassName: "Post", objec
570570
NSPredicate(format: "post = %@", PFObject(withoutDataWithClassName: "Post", objectId: "1zEcyElZ80"))
571571
</code></pre>
572572

573-
If you want to retrieve objects where a field contains a `PFObject` that match a different query, you can use `whereKey:matchesQuery`. Note that the default limit of 100 and maximum limit of 1000 apply to the inner query as well, so with large data sets you may need to construct queries carefully to get the desired behavior. In order to find comments for posts with images, you can do:
573+
If you want to retrieve objects where a field contains a `PFObject` that match a different query, you can use `whereKey:matchesQuery`. In order to find comments for posts with images, you can do:
574574

575575
<pre><code class="objectivec">
576576
// Using PFQuery
@@ -830,7 +830,7 @@ Query caching also works with PFQuery helpers including `getFirstObject` and `ge
830830

831831
## Counting Objects
832832

833-
Caveat: Count queries are rate limited to a maximum of 160 requests per minute. They can also return inaccurate results for classes with more than 1,000 objects. Thus, it is preferable to architect your application to avoid this sort of count operation (by using counters, for example.)
833+
Note: In the old Parse hosted backend, count queries were rate limited to a maximum of 160 requests per minute. They also returned inaccurate results for classes with more than 1,000 objects. But, Parse Server has removed both constraints and can count objects well above 1,000.
834834

835835
If you just need to count how many objects match a query, but you do not need to retrieve the objects that match, you can use `countObjects` instead of `findObjects`. For example, to count how many games have been played by a particular player:
836836

_includes/js/queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ query.notEqualTo("playerName", "Michael Yabuti");
4242
query.greaterThan("playerAge", 18);
4343
</code></pre>
4444

45-
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:
45+
You can limit the number of results by setting `limit`. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
4646

4747
<pre><code class="javascript">
4848
query.limit(10); // limit to at most 10 results
@@ -64,7 +64,7 @@ query.first({
6464
});
6565
</code></pre>
6666

67-
You can skip the first results by setting `skip`. This can be useful for pagination:
67+
You can skip the first results by setting `skip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
6868

6969
<pre><code class="javascript">
7070
query.skip(10); // skip the first 10 results
@@ -221,7 +221,7 @@ query.find({
221221
});
222222
</code></pre>
223223

224-
If you want to retrieve objects where a field contains a `Parse.Object` that matches a different query, you can use `matchesQuery`. Note that the default limit of 100 and maximum limit of 1000 apply to the inner query as well, so with large data sets you may need to construct queries carefully to get the desired behavior. In order to find comments for posts containing images, you can do:
224+
If you want to retrieve objects where a field contains a `Parse.Object` that matches a different query, you can use `matchesQuery`. In order to find comments for posts containing images, you can do:
225225

226226
<pre><code class="javascript">
227227
var Post = Parse.Object.extend("Post");
@@ -297,7 +297,7 @@ You can issue a query with multiple fields included by calling `include` multipl
297297

298298
## Counting Objects
299299

300-
Caveat: Count queries are rate limited to a maximum of 160 requests per minute. They can also return inaccurate results for classes with more than 1,000 objects. Thus, it is preferable to architect your application to avoid this sort of count operation (by using counters, for example.)
300+
Note: In the old Parse hosted backend, count queries were rate limited to a maximum of 160 requests per minute. They also returned inaccurate results for classes with more than 1,000 objects. But, Parse Server has removed both constraints and can count objects well above 1,000.
301301

302302
If you just need to count how many objects match a query, but you do not need to retrieve all the objects that match, you can use `count` instead of `find`. For example, to count how many games have been played by a particular player:
303303

_includes/php/queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $query->notEqualTo("playerName", "Michael Yabuti");
3535
$query->greaterThan("playerAge", 18);
3636
</code></pre>
3737

38-
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:
38+
You can limit the number of results by setting `limit`. By default, results are limited to 100. In the old Parse hosted backend, the maximum limit was 1,000, but Parse Server removed that constraint:
3939

4040
<pre><code class="php">
4141
$query->limit(10); // limit to at most 10 results
@@ -49,7 +49,7 @@ $query->equalTo("playerEmail", "[email protected]");
4949
$object = $query->first();
5050
</code></pre>
5151

52-
You can skip the first results by setting `skip`. This can be useful for pagination, though it is limited to a maximum of ten thousand:
52+
You can skip the first results by setting `skip`. In the old Parse hosted backend, the maximum skip value was 10,000, but Parse Server removed that constraint. This can be useful for pagination:
5353

5454
<pre><code class="php">
5555
$query->skip(10); // skip the first 10 results
@@ -214,7 +214,7 @@ $comments = $query->find();
214214
// comments now contains the comments for myPost
215215
</code></pre>
216216

217-
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `matchesQuery`. Note that the default limit of 100 and maximum limit of 1000 apply to the inner query as well, so with large data sets you may need to construct queries carefully to get the desired behavior. In order to find comments for posts containing images, you can do:
217+
If you want to retrieve objects where a field contains a `ParseObject` that matches a different query, you can use `matchesQuery`. In order to find comments for posts containing images, you can do:
218218

219219
<pre><code class="php">
220220
$innerQuery = new ParseQuery("Post");
@@ -276,7 +276,7 @@ You can issue a query with multiple fields included by calling `includeKey` mult
276276

277277
## Counting Objects
278278

279-
Caveat: Count queries are rate limited to a maximum of 160 requests per minute. They can also return inaccurate results for classes with more than 1,000 objects. Thus, it is preferable to architect your application to avoid this sort of count operation (by using counters, for example.)
279+
Note: In the old Parse hosted backend, count queries were rate limited to a maximum of 160 requests per minute. They also returned inaccurate results for classes with more than 1,000 objects. But, Parse Server has removed both constraints and can count objects well above 1,000.
280280

281281
If you just need to count how many objects match a query, but you do not need to retrieve all the objects that match, you can use `count` instead of `find`. For example, to count how many games have been played by a particular player:
282282

0 commit comments

Comments
 (0)