Hi Mongo Community,
I am currently working on migrating a few tables from SQL to Mongo and using the MongoDB Relational Migrator to achieve this.
I came across an issue which I believe could be a bug in the migrator but I may be wrong.
So, for example. I’m migrating “State” table to Mongo and I have set up the mappings to get the required collection. Please see screenshot below to understand what i have done.
You’ll see that there is a Provider table. I’m trying to get the “providerCode” field from the Provider table on the basis of “providerId” (foreign key) which exists in the Market table.
It should typically insert “providerId” in all documents and get the providerCode through providerId. Lastly, once it has set the providerCode in all documents, it should unset the providerId in the entire state collection.
The problem I encountered is that it is only unsetting the providerId from the first few documents and not the rest. After spending quite a bit of time, I noticed that providerId is not being unset after the migrator encounters a document where serviceableMarkets (parent of providerId) is null or empty.
To test this, I added a serviceable market for that State in SQL, and restarted the migrator. It successfully unset the providerId in the following documents but again stopped at one where serviceableMarkets is null or empty.
Please see screenshot below to understand this example.
Apologies for my messy sketching, as it was never my strongest suit.
Could you please see if this is a known bug or am I missing something? Please let me know if any further information is required for this.
Thanks a lot,
Shayan