chore: documents pagination: false

This commit is contained in:
James
2023-10-15 09:44:00 -04:00
parent e6e8fae1c5
commit a89e89fb80
2 changed files with 5 additions and 0 deletions

View File

@@ -131,6 +131,7 @@ const result = await payload.find({
depth: 2, depth: 2,
page: 1, page: 1,
limit: 10, limit: 10,
pagination: false, // If you want to disable pagination count, etc.
where: {}, // pass a `where` query here where: {}, // pass a `where` query here
sort: '-title', sort: '-title',
locale: 'en', locale: 'en',

View File

@@ -59,3 +59,7 @@ All Payload APIs support the pagination controls below. With them, you can creat
| ------- | --------------------------------------- | | ------- | --------------------------------------- |
| `limit` | Limits the number of documents returned | | `limit` | Limits the number of documents returned |
| `page` | Get a specific page number | | `page` | Get a specific page number |
### Disabling pagination within Local API
For `find` operations within the Local API, you can disable pagination to retrieve all documents from a collection by passing `pagination: false` to the `find` local operation. This is not supported in REST or GraphQL, however, because it could potentially lead to malicious activity.