I'm currently working with MongoDB and Azure CosmosDB for a project and I need to filter and copy data from one to the other.
The source data is a MongoDB collection named "Purchase", where each record has an 'AccountId'. I have a container in CosmosDB, named 'Account', that contains all the _id(s) I want to match with the 'AccountId' from the MongoDB source.
The goal here is to filter and copy only those records from the MongoDB source whose 'AccountId' matches any of the _id(s) in the 'Account' container in CosmosDB.
I'm using Azure Synapse Analytics for this operation, but I'm unsure how to write the correct filter using dynamic content to achieve this aim.
Has anyone dealt with this kind of scenario before, and could you provide some guidance on how to construct the filter? Any sample code, if available, would be extremely helpful.
Thank you for your time.