<?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: Import data into MongoDB - Bug with tMongoDBOutput, tExtractJSONFields in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281063#M55721</link>
    <description>Dear Friends,
&lt;BR /&gt;How to prevent the creation of empty value key in tmongodbOutput component.</description>
    <pubDate>Wed, 06 Apr 2016 11:34:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-06T11:34:47Z</dc:date>
    <item>
      <title>Import data into MongoDB - Bug with tMongoDBOutput, tExtractJSONFields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281061#M55719</link>
      <description>&lt;P&gt;Dear friends,&amp;nbsp;&lt;BR /&gt;I have a problem when trying to import data from flat file into MongoDB using tMongoDBOutput, tExtractJSONFields and tWriteJSONFields, describing in the scenario as below:&amp;nbsp;&lt;BR /&gt;Ref: internet, you can search by writing some words in data set of my example, sorry I cannot attach an URL.&amp;nbsp;&lt;BR /&gt;Here is a simple example of how to read a CSV file and convert the data into JSON format.&lt;BR /&gt;CSV&amp;nbsp;data (original data):&lt;BR /&gt;WDCi,Lean,KL&lt;BR /&gt;WDCi,Kai Herng,KL&lt;BR /&gt;WDCi,Walter,Sydney&lt;BR /&gt;WDCi,Deborah,Sydney&lt;BR /&gt;WDCi,Terry,US&lt;BR /&gt;FPT,Minh-Hieu,Hanoi&lt;BR /&gt;FPT,Anthony,Paris&lt;BR /&gt;FPT,Luis,Paris&lt;BR /&gt;JSON data (result wanted) in Mongo:&lt;/P&gt; 
&lt;PRE&gt;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"_id" : ObjectId("554b7fdcb42309e07933f70f"),&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"name" : "WDCi",&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"locations" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}, &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"location" : "Sydney",&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staffs" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}, &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"location" : "US",&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staffs" : {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staff" : "Terry"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;BR /&gt; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"_id" : ObjectId("554b7fdcb42309e07933f710"),&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"name" : "FPT",&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"locations" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;BR /&gt; &amp;nbsp; &amp;nbsp;}&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Firstly, I will use a tFileInputDelimited component to read the CSV file:&amp;nbsp;&lt;BR /&gt;&lt;A href="http://blog.wdcigroup.net/wp-content/uploads/2012/07/fileschema.png" target="_blank" rel="nofollow noopener noreferrer"&gt;http://blog.wdcigroup.net/wp-content/uploads/2012/07/fileschema.png&lt;/A&gt;Figure 1.1&lt;BR /&gt;Then, I will drop the tWriteJSONField component from the palette and link the output row of the tFileInputDelimited component to it.&amp;nbsp;After that, I define the schema for tWriteJSONField component. In this scenario, I create one column named “company” and set it as the output column of the component. The output row of tWriteJSONField component is linked to a tExtractJSONFields&amp;nbsp;component so that I can use to insert into MongoDB later.&lt;BR /&gt;&lt;BR /&gt;The result when I see in MongoDB is:&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"_id" : ObjectId("554b7fdcb42309e07933f70f"),&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"name" : "WDCi",&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"locations" : {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"locations" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}, &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"location" : "Sydney",&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staffs" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}, &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"location" : "US",&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staffs" : {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"staff" : "Terry"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;BR /&gt; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt;/* 2 */&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"_id" : ObjectId("554b7fdcb42309e07933f710"),&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"name" : "FPT",&lt;BR /&gt; &amp;nbsp; &amp;nbsp;"locations" : {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"locations" : &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;]&lt;BR /&gt; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;The problem is: &lt;FONT color="#999933"&gt;&lt;I&gt;&lt;U&gt;&lt;STRONG&gt;the array of location embedded document is included inside an "locations" element.&lt;/STRONG&gt; &lt;/U&gt;&lt;/I&gt;&lt;/FONT&gt;How could I do to have the result as wanted?&lt;BR /&gt;Thanks very much. &amp;nbsp;&lt;BR /&gt;p/s: I tried to uncheck the "Get nodes" box of location in tExtractJSONFields, but the result in MongoDB showed:&amp;nbsp;&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "_id" : ObjectId("554b7ba4b42394748949a3e3"),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "name" : "WDCi",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "locations" : ""&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "_id" : ObjectId("554b7ba4b42394748949a3e4"),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "name" : "FPT",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "locations" : ""&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 11:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281061#M55719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Import data into MongoDB - Bug with tMongoDBOutput, tExtractJSONFields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281062#M55720</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;You are able to generate directly desired result with tMongodbOutput, about the configuration of XML tree on tMongodbOutput, please see the following screenshots. 
&lt;BR /&gt;BRS 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDVj.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130565iB64D8E3B948C15FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDVj.png" alt="0683p000009MDVj.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDZu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140358i4FDF50480862A300/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDZu.png" alt="0683p000009MDZu.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDQv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156479iAD8FD46E33445430/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDQv.png" alt="0683p000009MDQv.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 01 Jun 2015 05:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281062#M55720</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-01T05:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Import data into MongoDB - Bug with tMongoDBOutput, tExtractJSONFields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281063#M55721</link>
      <description>Dear Friends,
&lt;BR /&gt;How to prevent the creation of empty value key in tmongodbOutput component.</description>
      <pubDate>Wed, 06 Apr 2016 11:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Import-data-into-MongoDB-Bug-with-tMongoDBOutput/m-p/2281063#M55721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-06T11:34:47Z</dc:date>
    </item>
  </channel>
</rss>

