Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
TRandy
Contributor III
Contributor III

Convert uuid to Object-id using Talend

Please can you help me ??

I have a field that provides ids but they are uuids. I would like to convert them to Object_id so that it can be consumed by mongo

Labels (3)
3 Replies
Anonymous
Not applicable

A MongoDB ObjectId is made up of different parts. These are explained here....

 

https://www.mongodb.com/docs/manual/reference/method/ObjectId/

 

While this will be possible in Talend, I am not sure that simply converting a UUID will be sufficient. You will need to construct it according to the rules in the doc above.

TRandy
Contributor III
Contributor III
Author

Thanks for your feedback @Richard Hall​ ,

Please how can i do it using Talend ??

 

Anonymous
Not applicable

If you want to create your own ObjectIds, you will need to do this following the MongoDB JavaDocs to do this in Java. These can be seen here....

 

https://mongodb.github.io/mongo-java-driver/3.6/javadoc/org/bson/types/ObjectId.html

 

But MongoDB should generate these IDs for you when you load new documents into the DB. Unfortunately this is not a Talend question, this is a question for MongoDB.