Home > Back-end >  Data being removed from MongoDB when restarting React app
Data being removed from MongoDB when restarting React app

Time:07-01

I'm working on inherited code, and I'm banging my head on the wall trying to figure out whats going on. My application has Posts with title and description that are stored in a MongoDB Docker Container. When the React App is shut down and restarted the title remains, but the description is removed from the DB. I've looked through what I can think of but can't find anything that would point to what is going on.

Any suggestions of where to look next? What would cause a database to lose the data when the application itself is shut down but not the DB? The DB is hosted on a Docker Image that is not shut down when the application shuts down, yet the data is removed. Really I just need an idea of where to look.

CodePudding user response:

Maybe there is some route being called on application startup that cleans up collections?

You sure that descriptions being deleted? if you would connect to mongodb with compass will you see empty description property in every document in Posts collection?

Also, you sure that docker container with mongodb is not being restarted? Can you see this from CREATED column of docker ps?

  • Related