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.
Great article,
I tried to make some changes to the parameters of the fields in the document, but it doesn't seem to have any effect
I removed the "required" parameter from the fields and there was no effect. How can changes be made to an existing document?
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.