mongodb atlas filters in ADF source is not working. returning no records!

KarthikShanth 26 Reputation points
2022-05-12T21:59:06.17+00:00

Hello, I have connected the MongoDB atlas as a source in the copy data tool and pulled the entire collections which worked flawlessly. Now, I m trying to apply the filters to pull the last few months' records, and I don't get any records.

This is what I have added inside the Filters box for source to pull data from 2022-01-12
{_id: ObjectId("61de60500000000000000000")}

is there any other way, we can pass the filters?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,406 Reputation points Microsoft Employee
    2022-05-16T12:33:05.477+00:00

    Hi @KarthikShanth ,

    Thank you for posting query in Microsoft Q&A Platform.

    I have gone through documentation of MongoDB connector in ADF. It looks The service supports consuming BSON document in Strict mode. Make sure your filter query is in Strict mode instead of Shell mode. More description can be found at MongoDB manual.

    Below is sample filter expression.
    "filter": "{datetimeData: {$gte: ISODate(\"2018-12-11T00:00:00.000Z\"),$lt: ISODate(\"2018-12-12T00:00:00.000Z\")}, _id: ObjectId(\"5acd7c3d0000000000000000\") }"

    Kindly check below documentation for more details and see if that helps. Please let us know how it goes.
    https://learn.microsoft.com/en-us/azure/data-factory/connector-mongodb?tabs=data-factory