hagopj13 / node-express-boilerplate

A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
MIT License
7k stars 2.05k forks source link

MongoDB data loss #289

Open flitzcore opened 9 months ago

flitzcore commented 9 months ago

I'm using MongoDb Atlas M0 Cluster for this project. It begin when I add a few user and do some testing. I add a few users. but I notice that I'm losing the users. Somehow the MongoDb data got reset. It left me with user collection but no user inside. Anyone have the same issue? Or anyone know why this happen?

waybacktolove commented 5 months ago

yes, this problem is affect to me. i losed mongodb data in all docs

waybacktolove commented 5 months ago

have you find the way to resolve this problem?

flitzcore commented 5 months ago

unfortunately no. I don't even know what caused it. I can't even replicate the error. All I can do is setup periodic backup

waybacktolove commented 5 months ago

Thank you for your response! I am wondering if the data loss might be caused by running MongoDB in Docker. Have you ever tried running MongoDB directly on a server? If so, was it feasible? Also, for your scheduled backup tasks, what would be a good interval for execution?

flitzcore commented 5 months ago

I run it in server all this time and still got data loss. I think its because this template use old version of mongodb. I run the backup once every 30 min because my app doesn't have critical data

apank commented 3 months ago

This is because you aren't supposed to run tests on your live db; I answered a similar question here

flitzcore commented 3 months ago

Yeah I finally realize that with the hard way....

Pada Rab, 7 Agu 2024 14.16, apank @.***> menulis:

This is because you aren't supposed to run tests on your live db; I answered a similar question here https://github.com/hagopj13/node-express-boilerplate/issues/294#issuecomment-2272780172

— Reply to this email directly, view it on GitHub https://github.com/hagopj13/node-express-boilerplate/issues/289#issuecomment-2272786694, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATWVRZJVSTC5ZOW6YDDXNODZQHCVXAVCNFSM6AAAAABDUGEZVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSG44DMNRZGQ . You are receiving this because you authored the thread.Message ID: @.***>