DEV Community

Discussion on: MongoDB deletes my db after unclean shutdown?

Collapse
 
ashraflobo profile image
Ashraf Lobo

Hey, I also experienced this unintentional deletion of collections. In my case, it has happed twice, but only happens when I'm working using the mongo shell. Usually, I use MongoDB Compass, but on some rare occasions, I have to fire up the shell. On two separate occasions, I have lost collections without being able to recover them. On the first one, I just started the mongo shell and all my collections, including others from different projects got deleted. On the second occurrence, I used mongo shell to stop my MongoDB server and the collection for the project I was currently working on got deleted. Could this also be considered an unclean shutdown?

PS: I haven't changed my data folder. It's still the same one I started with when I installed MongoDB.