<?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: From table row to MongoDB in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/From-table-row-to-MongoDB/m-p/2292374#M65451</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tMongoDBOutput component in Advanced Settings you can enable the option "Generate JSON Document" and can click on Configure JSON Tree option, inside which you can create your own JSON format as needed. On how to configure the JSON Tree(consisting of different datatypes and objects ), you can refer the below link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://help.talend.com/r/en-US/8.0/processing/configuring-a-json-tree&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 05:47:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-23T05:47:55Z</dc:date>
    <item>
      <title>From table row to MongoDB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/From-table-row-to-MongoDB/m-p/2292373#M65450</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Open Studio for Big Data 8.0 and I'm a newbie.&lt;/P&gt;&lt;P&gt;I have to import data from a SQL table into MongoDB.&lt;/P&gt;&lt;P&gt;A row is strutured like&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000PKpJ1AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141850i87C3F371941AAF76/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000PKpJ1AAL.png" alt="0695b00000PKpJ1AAL.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and target JSON/Mongo structure is like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;{&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;"_id": 1,&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;"child1": {&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "c1";&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name": "Name1"&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;},&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;"child2": {&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "c2";&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name": "Name2"&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;},&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;"objArray": [{&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "a1",&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name": "aName1"&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}, {&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"id": "a3",&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name": "aName3"&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;],&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;"objIdsArr": ["a1", "a3"]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;}&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tricky part I see is having two arrays in the target JSON document (objIdsArr, objArray) &lt;/P&gt;&lt;P&gt;that have to be built from a single table row and based on fields that can be null (i.e. rootArray2Id, &lt;/P&gt;&lt;P&gt;rootArray2Name).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a look at forum posts with examples of tWriteJsonField, I read the doc about tMongoDbOutput.&lt;/P&gt;&lt;P&gt;However it seems to me these components cannot implement directly my transformation.&lt;/P&gt;&lt;P&gt;Should I go for tJavaRow and use org.json stuff i.e. JSONObject, JSONArray to implement the transformation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After building a JSONObject, can tMongoDBOutput handle it directly? How do I setup the final map inside?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/From-table-row-to-MongoDB/m-p/2292373#M65450</guid>
      <dc:creator>mmctony</dc:creator>
      <dc:date>2024-11-15T23:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: From table row to MongoDB</title>
      <link>https://community.qlik.com/t5/Talend-Studio/From-table-row-to-MongoDB/m-p/2292374#M65451</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tMongoDBOutput component in Advanced Settings you can enable the option "Generate JSON Document" and can click on Configure JSON Tree option, inside which you can create your own JSON format as needed. On how to configure the JSON Tree(consisting of different datatypes and objects ), you can refer the below link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://help.talend.com/r/en-US/8.0/processing/configuring-a-json-tree&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 05:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/From-table-row-to-MongoDB/m-p/2292374#M65451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-23T05:47:55Z</dc:date>
    </item>
  </channel>
</rss>

