Choosing MongoDB Was The Biggest Mistake Of My College Life😥
It was the final year of my college, and I was left with 6 months to build my major project, which was a healthcare app {(Patients), (doctors), (appointments), (prescriptions)} All data were connec...

Source: DEV Community
It was the final year of my college, and I was left with 6 months to build my major project, which was a healthcare app {(Patients), (doctors), (appointments), (prescriptions)} All data were connected to each other in a hierarchical relation. I picked MongoDB because people around me were using it. Spent two months building on it, hit three problems I could not cleanly solve, and migrated to PostgreSQL before submission. Why MongoDB made sense at the start When requirements are changing every week, the last thing you want is to deal with database migrations. MongoDB lets you skip that. No schema upfront, just start inserting data and add fields as you go. // Week 1 { name: "Rahul", age: 24, phone: "9876543210" } // Week 3, requirements changed { name: "Rahul", age: 24, phone: "9876543210", bloodGroup: "O+", doctorId: "abc123" } That doctorId is a plain string pointing to a doctor document. No foreign key. No constraint. If that doctor gets deleted, this field sits there pointing at not