Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

How to query all items, without pagination?

default discord avatar
4000degrees2 years ago
6

How to get all items without pagination?


Tried setting limit to 0 and -1.


Thanks

  • discord user avatar
    jarrod_not_jared
    2 years ago

    I’m not sure you can at the moment. You would have to query for at least 1 and then get the totalDocs from there and then query again for that number

  • discord user avatar
    denolfe
    2 years ago

    I would expect

    ?limit=0

    to return all documents. What behavior are you seeing?



    Hmm, just tested this out. 0 doesn't appear to work how I'd expect. Could always pass 999



    Might submit this as a bug, tbh

  • default discord avatar
    4000degrees2 years ago
    @967118574445547650

    this is what I do atm. Thanks, will create a bug

  • default discord avatar
    snackdexlast year

    it looks like if i pass 0 it returns all documents, but i'm not seeing this documented anywhere and i can't find if the issue was closed. is this the way?

  • default discord avatar
    cbratschilast year

    Also had to manually find the right value and 0 was fine.

  • default discord avatar
    jessrynkarlast year

    We'll get it added into the documentation to help others, thanks for reporting 👍

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.