tmongodbinput could not read from Mongo document with array field

One Star

tmongodbinput could not read from Mongo document with array field

Hi,
I could not able to ready mongo array sub-fileds using tmongodbinput. Here is the document , i am trying read. Of this mongo document, I can read StartEvent and EndEvent fields like account_id and end_cause easily. But for fields like report_tag and report_data, i get Exception. Is there a way to read the array fields using tmongodbinput or some other talent components.
{ "_id" : ObjectId("5155a6c3c2e6a95fd5c7d25a"),
"StartEvent" : { "Timestamp": NumberLong("1361769140226"),
"account_id" : "1",
"version" : "2.9.0" },
"EndEvent" : { "timestamp" : NumberLong("1361769164773")
"end_cause" : "terminated" },
"Details" :
}

Exception in component tMongoDBInput_1
java.lang.IllegalArgumentException: BasicBSONList can only work with numeric keys, not:
at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:161)
at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:152)
at org.bson.types.BasicBSONList.get(BasicBSONList.java:104)
at mongo.mongo_calldetails_0_1.Mongo_CallDetails$1DBObjectInputUtil_tMongoDBInput_1.getValue(Mongo_CallDetails.java:611)
at mongo.mongo_calldetails_0_1.Mongo_CallDetails.tMongoDBInput_1Process(Mongo_CallDetails.java:628)
at mongo.mongo_calldetails_0_1.Mongo_CallDetails.runJobInTOS(Mongo_CallDetails.java:960)
at mongo.mongo_calldetails_0_1.Mongo_CallDetails.main(Mongo_CallDetails.java:816)
One Star

Re: tmongodbinput could not read from Mongo document with array field

did you fix this problem?
One Star

Re: tmongodbinput could not read from Mongo document with array field

i downloaded a component off of the talend exchange name tJsonNormalize.  i did a tmap off of this to a tPivotColumnDelimited then off that csv i was able to tmap to the output component. 
One Star

Re: tmongodbinput could not read from Mongo document with array field

I am too having the same problem. I cannot retrieve array sub-fields using tmongodbinput. It will be very useful if anyone suggest me answer. I am not getting any error. Rather no values are displayed while using dot operator to represent array of fields.

Thank you,
Priya
One Star

Re: tmongodbinput could not read from Mongo document with array field

I am having the same problem. Did anyone fix this issue ?
I have that kind of json structure in my mongo collection :
{
    "id":"1",
    "name":"John",
    "addresses" :
}
I want to have an output row like :
Is that possible ?
Thanks !
MC
One Star

Re: tmongodbinput could not read from Mongo document with array field

Please try using Upsert option in the tMongoDboutput !!
One Star

Re: tmongodbinput could not read from Mongo document with array field

Maybe this is usefull: