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.

Collection not being shown in admin panel

default discord avatar
liorix012 years ago
4

Hi all, something very strange in my production deployment. When I try to view a collection in the admin panel none is being displayed and I see this error message. Any pointer or ideas to what might be the issue?

  • discord user avatar
    dribbens
    2 years ago

    Oh, wait, what Payload version are you on?



    toObjectId was used in an older version that is not compatible with some mongo "compliant" hosting options like documentDB and azure cosmos db



    those implementations are missing a bunch of aggregates so we re-wrote them. That error should go away when you upgrade Payload to latest.

  • default discord avatar
    liorix012 years ago

    "payload": "^1.5.9",



    mongodb



    db hosted by us



    the admin tries to fetch the following url: serverurl/api/home-pages?locale=en&depth=0&draft=true



    if we remove the draft=true, it works but the admin sends draft=true



    this is the error we're getting if we take the url and try to fetch it via the browser url field:



    {


    "errors": [


    {


    "message": "Unrecognized expression '$toObjectId'"


    }


    ]


    }

  • discord user avatar
    dribbens
    2 years ago

    There were a lot of changes to versions since 1.5.9 so you're going to want to upgrade. I'm pretty certain that will solve this for you.



    There were some breaking changes and a migration script will be needed if you have data on versioned collections already



    https://github.com/payloadcms/payload/blob/master/CHANGELOG.md#-breaking-changes
  • default discord avatar
    liorix012 years ago

    Hi Dan, we had an old version of mongodb, once we upgraded it worked. I will take your advice and upgrade to the latest payload version. many thanks for your help!

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.