<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BinData in mongo to String UUID Conversion in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314305#M85081</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for detailed explanation. I haven't tried dynamic approach yet. Let me try this and get back to you.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jul 2022 11:12:09 GMT</pubDate>
    <dc:creator>raowaqasakram</dc:creator>
    <dc:date>2022-07-24T11:12:09Z</dc:date>
    <item>
      <title>BinData in mongo to String UUID Conversion</title>
      <link>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314303#M85079</link>
      <description>&lt;P&gt;I have data in source (mongoDB) which i'm trying to read and print using tLogRow. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm storing data into mongo as follow , &lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;"_id" : "ANY-UUID-HERE", &lt;/P&gt;&lt;P&gt;"name" : "test"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I look on mongoDB then it have following record&lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;"_id" : BinData(3,"lUUL1Ak/Fj8h4fphNR19tw=="), &lt;/P&gt;&lt;P&gt;"name" : "test"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;while loading into Talend , it is showing as follow&lt;/P&gt;&lt;P&gt;_id = org.bson.types.Binary@c3bf9cd8&lt;/P&gt;&lt;P&gt;"name" : "test"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where as the datatype is String for the field "_id".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not getting any way to convert this into Talend (have tried few ways in Java but didn't worked.). I just know we can do it in tJavaRow.&lt;/P&gt;&lt;P&gt;Any help would be appreciated thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:42:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314303#M85079</guid>
      <dc:creator>raowaqasakram</dc:creator>
      <dc:date>2024-11-15T22:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: BinData in mongo to String UUID Conversion</title>
      <link>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314304#M85080</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not a MongoDB expert, however I have an explanation for the following output you see:&lt;/P&gt;&lt;P&gt;org.bson.types.Binary@c3bf9cd8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens in the background is that there's no .toString() implementation that would provide a String representation of the object. Instead what you see is:&lt;/P&gt;&lt;P&gt;This object that you called .toString() on is:&lt;/P&gt;&lt;P&gt;Type X&lt;/P&gt;&lt;P&gt;It's short ID inside the JVM is: Y. &lt;/P&gt;&lt;P&gt;Thus it results in X@Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What one needs to do in this case is: Understand what functions the object itself provide. This depends on the SDK version one uses lets suppose your job uses 3.6: https://mongodb.github.io/mongo-java-driver/3.6/javadoc/org/bson/types/Binary.html&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see it provides a .getData() that is byte[] and I guess you'd have to convert it to a Base64 representation to get back the original string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tried to use the "dynamic" approach of Talend? By providing a single column in the schema and setting the columns DB Name as *  talend should return the raw JSON object, maybe this will be helpful?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;   Balázs&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 10:56:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314304#M85080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-24T10:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: BinData in mongo to String UUID Conversion</title>
      <link>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314305#M85081</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for detailed explanation. I haven't tried dynamic approach yet. Let me try this and get back to you.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 11:12:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/BinData-in-mongo-to-String-UUID-Conversion/m-p/2314305#M85081</guid>
      <dc:creator>raowaqasakram</dc:creator>
      <dc:date>2022-07-24T11:12:09Z</dc:date>
    </item>
  </channel>
</rss>

