MongoDB writer node date conversion

Hi Community users,

I am writing the below data into MongoDB database using MongoDB writer node. I want MongoDB to recognize the column ‘event_date’ as a date column and ‘event_datetime’ as a timestamp column (or at least as a datetime column). But what’s happening is everything is getting inserted as a string. This has serious issues in the visualization layer as data types are not getting recognized correctly. I tried converting the dates into unix timestamp formats and inserted as strings (as mentioned in MongoDB Extended JSON (v2) syntax) but that also doesn’t work. Until we specify the datatype during insertion into MongoDB, it seems like MongoDB will not recognize the data being inserted.
How to deal with this situation ?

Thanks
Sudheer

Hi Sudheer,

As this differs from the usual DB framework I am not sure how to achieve this but I found the following reference:

https://docs.mongodb.com/manual/reference/mongodb-extended-json/

So if you could provide the data in this extended format it should recognize the correct cell/column format.

Best regards,
Michael

Hi Michael,

This would probably work. But can you suggest how to achieve this using knime ?

Thanks

Hi Sudheer,

sorry for the delayed reply. I spoke with the developer of the nodes and it seems that unfortunately it is not possible to achieve this with KNIME at the moment.

Best,
Michael

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.