How to insert an array type data into MongoDB by Talend tMongoDBOutput

One Star

How to insert an array type data into MongoDB by Talend tMongoDBOutput

Hello Guys,
when I insert a row in Mongo shell:
db.mycoll.insert(
  { 
  "column1":
}
)
result is:
{ "_id" : ObjectId("58b82d52957107b7c5d11062"), "column1" : }
but when I load data with Talend tMongoDBOutput component, even I choice column1's data type is "Object" in output side, Talend still load it as string, result like this:
{ "_id" : ObjectId("58b82d52957107b7c5d11062"), "column1" : "" }
Because input_row is from Oracle, it is string, so I tried to add a tJavaRow component convert the string to array, but I can not set the result value to ouput_row which is tMongoDBOutput component's input_row, so anybody know What the best way I can do to resolved this problem? By the way, I must use Talend tMongoDBOutput to do it.
Thanks
Moderator

Re: How to insert an array type data into MongoDB by Talend tMongoDBOutput

Hi,
You can perform this by passing an array of json documents to the insert method on a collection in the mongo shell?
Have you tried this "function" in tMongoDBRow to see if it works?
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

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

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now