Four Stars

Reading date using textractjsonfield

Hi All,

 I have created tmongoinput to read the collection from the source MongoDb. The collection has a datearray, Inorder to read this array I have used textractJsonfield component. I am reading by JsonPath ,  jsonfield i have given as DateArray, and in the loop I have give it as "$.[*]" mapping json query i have given it as "testdate1". The sample JSON field is shown below. The output that I should get is the date value : 2016-04-05T23:00:00.000Z, but I am getting it as {"$date":"2016-04-05T23:00:00.000Z"}. Is there way in textractjsonfield that i can remove the $date value and read the value alone. Can you please help me in this.

 

"DateArray" : [
{
"testdate1" : ISODate("2016-04-05T23:00:00.000Z"),
"testDate2" : ISODate("2016-04-29T23:00:00.000Z"),
}
},
{
"testdate1" : ISODate("2016-05-05T23:00:00.000Z"),
"testdate2" : ISODate("2016-05-30T23:00:00.000Z")
}
]

1 REPLY
Moderator

Re: Reading date using textractjsonfield

Hello,


DhanaPalani wrote:

Hi All,

 I have created tmongoinput to read the collection from the source MongoDb. The collection has a datearray, Inorder to read this array I have used textractJsonfield component. I am reading by JsonPath ,  jsonfield i have given as DateArray, and in the loop I have give it as "$.[*]" mapping json query i have given it as "testdate1". The sample JSON field is shown below. The output that I should get is the date value : 2016-04-05T23:00:00.000Z, but I am getting it as {"$date":"2016-04-05T23:00:00.000Z"}. Is there way in textractjsonfield that i can remove the $date value and read the value alone. Can you please help me in this.

 

"DateArray" : [
{
"testdate1" : ISODate("2016-04-05T23:00:00.000Z"),
"testDate2" : ISODate("2016-04-29T23:00:00.000Z"),
}
},
{
"testdate1" : ISODate("2016-05-05T23:00:00.000Z"),
"testdate2" : ISODate("2016-05-30T23:00:00.000Z")
}
]


Would you mind posting your tExtractJsonfield component setting screenshot on forum which will be helpful for us to address your problem?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.