One Star

tMongoDB in UPSERT mode.. how to do ?

I'm trying to use the tMongoDBoutput for a Json file injection.
This is my schema

In the INSERT mode, there is no problem : i found all my data with the
> db.myCollection.find()
In the UPSERT mode, the component doesn't send me any error but nothing is inserted in the collection... what was wrong ?
Any idea ?



2 REPLIES
Moderator

Re: tMongoDB in UPSERT mode.. how to do ?

Hi,
Have you checked out " Die on error" option to see if there is any error printed on console?
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.
One Star

Re: tMongoDB in UPSERT mode.. how to do ?

hi (sorry for this late answer due to vacation).
Effectively, i see this error
Exception in component tMongoDBOutput_1
java.lang.Exception: Must have at least one key in schema
    at etl_cres.jsonloader_0_1.jsonLoader.tFileList_1Process(jsonLoader.java:2324)
    at etl_cres.jsonloader_0_1.jsonLoader.tMongoDBConnection_1Process(jsonLoader.java:1848)
    at etl_cres.jsonloader_0_1.jsonLoader.runJobInTOS(jsonLoader.java:3782)
    at etl_cres.jsonloader_0_1.jsonLoader.main(jsonLoader.java:3618)

How can i introduce a key in schema as i load files and the only field i have is a single field named "content" for Talend ?