Adding datetime field to json-> mongodb pipeline

Evan Wellens 66 Reputation points

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

    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 .

    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')


    Please do let me know how it goes .
    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