Error: CastError: Cast to ObjectId failed for value

default discord avatar
6 months ago

Recently, I started getting this error when I create docs from my website. I don't know exactly when started. When I create docs with a user-related, the doc it's created but I get this error. Any thoughts?

[18:56:12] ERROR (payload): CastError: Cast to ObjectId failed for value "{ 0|admin | id: '6422b93a36145bda8bf6ad09', 0|admin | name: 'Jorge', 0|admin | LastNames: 'Escamilla', 0|admin | role: 'attendee', 0|admin | createdAt: '2023-03-28T09:54:02.620Z', 0|admin | updatedAt: '2023-03-28T18:55:59.271Z' 0|admin | }" (type Object) at path "_id" for model "users" 0|admin | at model.Query.exec (/home/cronos/labnl-admin/node_modules/mongoose/lib/query.js:4789:21) 0|admin | at model.Query.Query.then (/home/cronos/labnl-admin/node_modules/mongoose/lib/query.js:4888:15) 0|admin | at processTicksAndRejections (node:internal/process/task_queues:95:5)
  • discord user avatar
    Payload Team
    5 months ago

    Hey @akacronos are you still getting this error?

  • default discord avatar
    5 months ago

    No @jesschow , thanks, it was an access problem. 🙂

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.