MongoDB output collection with JSON tree attribute type 'objectid'

Four Stars

MongoDB output collection with JSON tree attribute type 'objectid'

Friends,

 

Im a beginner to talend, creating a job to load data from MySQL to MongoDB. We have two collections (MASTER and DETAIL) in MongoDB, we load MASTER collection first and '_id' field of type 'ObjectId' is generated automatically. While loading DETAIL collection, we want the '_id' from MASTER collection to be assigned to a new field in DETAIL collection on certain join criteria in 'tmap'.

 

We are using JSON tree in tMongoOutput component to configure the collection structure, here '_id' field from MASTER collection is loading only as String field. Our expection is output field type should be 'ObjectId'. In JSON tree, is there any attribute type like 'objectid'?

 

Please provide your inputs to solve the problem.

 

Thanks & Regards,

Goushik Murugesan

Moderator

Re: MongoDB output collection with JSON tree attribute type 'objectid'

Hello,

Please try to make the attribute type of ‘_id’ as @type and setting the Static Value to object in the Link target.

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.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now