Hi there, I am new with Mongo and I need to migrate the data from a SQL Server database to Mongo. This database contains data of a clinic such as appointments, visits, invoices, patients, practitioners, users etc. After migrating this data I will need to query the data to produce reports, for instance, to get the appointments in a period of time.
I am wondering what is the right approach to migrate the data to Mongo. Any advice?
I would not claim that it is the best approach but it is the one I use.
I simply migrate each table into a corresponding collection. I use $lookup as I do SQL join setting the appropriate indexes resulting in possibly the worst model for MongoDB. But then the beauty of schema less MongoDB kicks in and I refine my model attacking the slowest or most used parts first. For example, invoices refer to invoice_items and other things. It is easy to refactor invoice_items to be embedded inside the invoices collection because invoices contains a limited number of invoice_items belong to a single invoice.