I am building ETL pipeline using Azure DataFactory from MongoDB to Azure Synapse Anlytics.
This is my sample document
{
"_id" : ObjectId("62b6f74ce3a7b8ee664c675d"),
"event_name" : "click_search",
"screen_name" : "home",
"product_sku" : "",
"screen_id" : "5005",
"action_id" : "1023",
"created_on" : ISODate("2022-06-25T16:53:48.000+05:00")
}
I used simple Copy Data activity and then preview data for source (MongoDB) is showed me like this
{
"_id": {
"$oid": "62b6f74ce3a7b8ee664c675d"
},
"event_name": "click_search",
"screen_name": "home",
"product_sku": "",
"screen_id": "5005",
"action_id": "1023",
"created_on": {
"$date": 1656158028000
}
}
My First question is why date is coming in different format in datafactory?
Secondly
while mapping it show me like this

due to this when I ran pipeline it gives this error
Message=Column 'created_on' contains an invalid value '1656158028000'. Cannot convert
'1656158028000'to type 'DateTime'.,Source=Microsoft.DataTransfer.Common,
''Type=System.FormatException,Message=String was not recognized as a valid
DateTime.,Source=mscorlib,'
I tried to find this issue in documentation Copy data from or to MongoDB using Azure Data Factory or Synapse Analytics
but didn't get any luck, please let me know what's happening under the hood? Why MongoDB send date like this and how can we resolve it. Thank you.