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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TMongoDBOutput cannot update document

Hi all,

 

I think this is very simple, but i have posted 3 times and no one can help.

I just find a way to update data from a Mongodb collection and then save it back to the right place.

So that, I use a tMongoDBInput to read data, and use tMap to change the data and finally use a tMongoDBOutput to save data

All the schemas have _id as key field already, and currently I set the Action on Data to Update

The job is running successfully, but there is no update in database.

 

0683p000009M9If.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello all,

I found it, just an wierd require from MongoDB syntax, let it here for other to refference

 

The problem here is cause by using Object ID (which is auto generated by Mongodb when you insert new document into the database). Just try to avoid using it as you key, but if you really want to use, please add ObjectID('[your document id here]').

That is all the story which take me out more than 1 week.

0683p000009M9IR.png

View solution in original post

3 Replies
fdenis
Master
Master

did you set a key value for the update?
Anonymous
Not applicable
Author

Hi fdenis,

 

Yes, sure. I also change the type of the _ID into OBJECT to map the data type in database

Anonymous
Not applicable
Author

Hello all,

I found it, just an wierd require from MongoDB syntax, let it here for other to refference

 

The problem here is cause by using Object ID (which is auto generated by Mongodb when you insert new document into the database). Just try to avoid using it as you key, but if you really want to use, please add ObjectID('[your document id here]').

That is all the story which take me out more than 1 week.

0683p000009M9IR.png