Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gattuchaitanya
Contributor
Contributor

Insert ObjectID in to mongo array elements

Hi All ,

We are migrating the data from Oracle to Mongo DB using Talend tool and we would need to add the object Id to each object inside an array. We have tried to use attribute @type with fixed value as ObjectId but it didn't worked. Can someone assist us here.

 

We need the output as below:

{

"_id":"12243",

"name": "ABCD",

"city":"XYZ",

"requests":[

{

"_id" : ObjectId("5efdcf15ea9355c419fc9699"), // How to generate this ObjectId using talend tool in Mongo

"type":"department",

"value":"Science"

},

{

"_id" : ObjectId("K279kkqasj8ac023878hjc"), // How to generate this ObjectId using talend tool in Mongo

"type":"department",

"value":"Commerce"

}

]

 

 

Labels (3)
2 Replies
Gattuchaitanya
Contributor
Contributor
Author

Can someone help here

Gattuchaitanya
Contributor
Contributor
Author

Can someone help here