Adding datetime field to json-> mongodb pipeline

Evan Wellens 66 Reputation points
2021-09-08T20:58:26.26+00:00

We have several pipelines in azure data factories that are mapping json documents in blob storage to documents in mongodb. Now we need some of these to TTL. My understanding is they need an index with a special attribute in order to do so which is of date time. Is there a way to add this field during the pipeline execution ? Thanks in advance for any advice

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,386 Reputation points Microsoft Employee
    2021-09-10T01:05:16.387+00:00

    Hello @Evan Wellens ,
    Thanks for the ask and using the Microsoft Q&A platform .
    I am assuming that you are using copy activity and if thats the case , please try out adding an addionalcolumn .

    https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-overview#add-additional-columns-during-copy

    I think you can use the utcnow() as an expression and it should work out .

    updated on 9/14

    I did tried the below expression and I think it should work .

    @formatDateTime(utcnow(), 'yyyy-dd-MM-hh-mm-ss-sss')

    132100-image.png

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider clicking on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    utcnow()