DEV Community

Discussion on: Flask Rest API -Part:1- Using MongoDB with Flask

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

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.

Collapse
 
engmsilva profile image
Marcelo Ribeiro da Silva

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.