Four Stars

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 ?

 

Capture3.JPG

  • Data Integration
1 REPLY
Four Stars

Re: MongoDB and ObjectId

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.