Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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)
Labels (3)
6 Replies
Anonymous
Not applicable
Author

did you fix this problem?
_AnonymousUser
Specialist III
Specialist III

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. 
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

Please try using Upsert option in the tMongoDboutput !!
_AnonymousUser
Specialist III
Specialist III

Maybe this is usefull: