You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2017-03-02 22:53:32

Julietzhao0006
Member
3 posts

Julietzhao0006 said:

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

Tags: [, mssql]

Hello Guys,
when I insert a row in Mongo shell:
db.mycoll.insert(
  { 
  "column1": [ 
    "AAA123", 
    "BBB123" 
  ]
}
)
result is:
{ "_id" : ObjectId("58b82d52957107b7c5d11062"), "column1" : [ "AAA123", "BBB123" ] }
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" : "[ "AAA123", "BBB123" ]" }
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

Offline

#2 2017-04-07 10:13:45

xdshi
Talend Team


xdshi said:

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


What we can do is to make sure that Talend will be your best choice!

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy