MongoDB output collection with JSON tree attribute type 'objectid'

Highlighted
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

Highlighted
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 GARTNER 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

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

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

Blog