If I’m building a healthcare app using MongoDB, how should I organize and store important data like patients, their doctor appointments, their medicine prescriptions, and their medical reports?
1 Like
steevej
(Steeve Juneau)
July 16, 2025, 2:10pm
2
I would use 4 collections:
patients
appointments
prescriptions
reports
For reports, I would use the attribute pattern.
For appointments, I would TTL indexes.
For more details, please follow up with more detailed questions. Followups on all your threads would also be appreciated. Specially on the ones you got answers like:
This is quite easy. Use at your own risk.
const _id = driver_id ;
const position = driver_position ; /* can be lat,long,address or zip */
const busy = true ;
const available = false ;
const $set = { position , busy , available }
db.driver_status.updateOne( { _id } , { $set } ) ;
Hi @Suheb_Multani , this question seems a bit open-minded, there are other factors to consider but how I would think around it would be to create documents daily in a collection, every year leads to 366 documents max, this ensures it can scale easily, you can also decide to delete older documents if they are no longer relevant.
Each document can then represent the menu & special offers for that day. This model assumes that everything is always dynamic and is going to change which might not be th…
Hey Suheb,
If you’re working with large files (like images, videos, or documents), the most efficient way in MongoDB is usually to use GridFS. It’s built for handling large files , it splits them into chunks and stores them across collections, so you don’t hit size limits or performance issues.
For smaller files (under 16MB), storing them directly in a document using Buffer or BinData is possible, but it’s not great for performance long-term , especially if you’re dealing with lots of them.
A…
2 Likes