Skip to content

fix: update docs default limit value to 0 in Local API example #12155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Susmita-Dey
Copy link

What?

An implicit default limit of 10 documents returned when using the Payload Local API as mentioned in the document as I have set the limit:0 to disable it.

Why?

Because all of the time it's not necessary to fix the limit to 10 as default, there can be cases to disable it.

How?

const result = await payload.find({
  collection: 'posts', // required
  depth: 2,
  page: 1,
  limit: 0, // default to 0 to disable limit, to enable increase the limit
})

Fixes #12140

@Susmita-Dey Susmita-Dey changed the title fix(docs): update default limit value to 0 in Local API example fix: update default limit value to 0 in Local API example Apr 18, 2025
@Susmita-Dey Susmita-Dey changed the title fix: update default limit value to 0 in Local API example fix: update docs default limit value to 0 in Local API example Apr 18, 2025
@ryami333
Copy link

I don't think this really addresses my issue satisfactorily. I think there needs to be a new row in this table to describe the limit option altogether: https://payloadcms.com/docs/local-api/overview#local-options-available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: no mention that limit: 0 disables pagination
2 participants