Hello @moorenmike, the team suggests two options:
1. getAllByType()
with limit
:
getAllByType()
will fetch all documents. To limit the number of documents returned, the limit
option can be passed. Once the function reaches that limit, it will stop requesting pages.
await client.getAllByType('page', { limit: 3 })
2. getByType()
with pageSize
:
getByType()
only fetches one page, thus pageSize
will limit the results to the size of that single page. The response will include the pagination metadata along with the data using this method, however, so you’ll need to access the results using res.results
.
await client.getByType('page', { pageSize: 1 })