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.

Validation error for field which no longer exists (with that name)

default discord avatar
azulspace2 years ago
4

While running dev: What could cause validation error with old field name?


I get complain about field "menu-name", but I changed to "menu_name" a little while ago, and can't no longer find references to "menu-name" in my codebase.


Already deleted: node_modules/.cache/webpack

  • default discord avatar
    paulpopus2 years ago

    Is the previous field name in the database?



    That's the first place I would check when changing data structures, unless you added no data ofc

    @891688759496687697
  • default discord avatar
    exo37182 years ago

    Probably you still have the index of that field in your mongodb. Use

    mongosh

    and connect to your databse, from there use

    db.<collection>.getIndexedes()

    and if you still see the associated index just drop it 🙂

  • default discord avatar
    paulpopus2 years ago

    if you prefer a GUI like me, compass is solid

    https://www.mongodb.com/products/compass
  • default discord avatar
    azulspace2 years ago

    Thank you guys! Old index was still there. Seems to be all good now after deleting it 👍 And yeah, using the Compass, pretty handy

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.