How to remove a field in MongoDB? #12248
Unanswered
jensjeflensje
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When removing a field from the collection schema, it doesn't get removed in existing MongoDB documents. I'm already using migrations to migrate data when changing the schema, so I thought it would be easy to remove fields in the migrations too.
I tried settings the field to undefined in a payload update, but that didn't work. I also tried removing the key from the object and updating with that entire object.
Does anyone know how to do it? I'm using Payload v2.32.2.
Beta Was this translation helpful? Give feedback.
All reactions