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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

MongoDB and ObjectId

Hello,

I have a job in which I get documents from a collection with their _id (ObjectId), and I wish to realise a SET action on the collection with this _id as a key.

I try to use the Object field type for the _id field, but the set action doesn't work, and then I try upsert with set, it create me a new document with the same _id, but Integer format.

 

How can I do to declare the _id as ObjectId in my query ?

 

0683p000009LuIq.jpg

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hello,

I try the solution proposed in the help page of the "tWriteJSONField" : "For an object element, you need to add an attribute named class and set its static value to object". But it doesn't work, neither with object nor ObjectId.

 

Anonymous
Not applicable
Author

Hi,

 

When you fetch the documents, "_id" is coming as type string not ObjectId. So while upserting documents it will add a new docoument instead of updating existing one as

_id(str) != _id(ObjectId).

I tried to find solutions, but talend doesn't have any datatype as ObjectID. I hope they bring this datatype in future versions.

I upsert documents on some composite keys (not objectID) defined in query node in xml tree.

 

Regards

Ravinder