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?
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
Did you get chance try using
$filter
? Kindly try and see if that helps. Below is link for more details on filter in MongoDB.
https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/