I am trying to select some documents from documentDB collection, in an incremental way, so every slice will select based on the "timeCreated" field of the collection. The problem is that this field (timeCreated) is in seconds since the epoch (1970-01-01) and I could not find the proper format here.
As project's assumptions, we are working with Azure Portal and without any programming interface, so the only solution I could think of is creating UDF in the DocumentDB that will transform the seconds field, to a dateTime field, but any approach that will only involve documentDB sql is much better.
This is the date data in the documentDB:
"serverTimestamp": {
"$date": 1446130451707
},
This is the way to use slice's startDate and endDate in the pipeline (from Azure documentation) :
"source": {
"type": "SqlSource",
"sqlReaderQuery": "$$Text.Format('select * from MyTable where timestampcolumn >= \\'{0:yyyy-MM-dd HH:mm\\' AND timestampcolumn < \\'{1:yyyy-MM-dd HH:mm\\'', WindowStart, WindowEnd)"
},
Is there another way, besides UDF, to format WindowStart/WindowEnd to seconds?
Thanks!