It's probably because when you give constrains to the field like required, mongodb creates an index for the field. So, to make the change take place you either have to delete the index or easier thing will be to delete the database (don't do that in production 😉)
Please let me know if deleting the index or the database solves your issue.
It's probably because when you give constrains to the field like required, mongodb creates an index for the field. So, to make the change take place you either have to delete the index or easier thing will be to delete the database (don't do that in production 😉)
Please let me know if deleting the index or the database solves your issue.
I had already tried to delete the bank and the index, but I was looking for an alternative to a document that cannot be deleted.