<?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 tMongoDBOutput - getting null array when value is null in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222385#M16020</link>
    <description>&lt;P&gt;I'm writing to MongoDB - using the tMongoDBOutput using the generate JSON Document option.&amp;nbsp; I'm doing a Set action to fill in addresses.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Input fields (all are string)&lt;/P&gt; 
&lt;P&gt;address1&lt;/P&gt; 
&lt;P&gt;address2&lt;/P&gt; 
&lt;P&gt;city&lt;/P&gt; 
&lt;P&gt;state&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The target collection has a unique integer value CustomerID which is used for the "query".&lt;/P&gt; 
&lt;P&gt;Under the document there is&lt;/P&gt; 
&lt;P&gt;rootTag&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp; data&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addresses (@class array)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row5 (object, loop element)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address1&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address2&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; city&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;with the obvious mapping.&lt;/P&gt; 
&lt;P&gt;This works fine... except when address2 is null ... I get the address2 output in Mongo as an 0 element array!&amp;nbsp; The advanced option "create empty element if needed" is not checked.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I want is either address2 being an empty string, or not having an address2 element if there is no address2 data.&amp;nbsp; I tried in a tMap to convert null to "", but got the same result.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 06:11:20 GMT</pubDate>
    <dc:creator>bglaplante</dc:creator>
    <dc:date>2024-11-16T06:11:20Z</dc:date>
    <item>
      <title>tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222385#M16020</link>
      <description>&lt;P&gt;I'm writing to MongoDB - using the tMongoDBOutput using the generate JSON Document option.&amp;nbsp; I'm doing a Set action to fill in addresses.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Input fields (all are string)&lt;/P&gt; 
&lt;P&gt;address1&lt;/P&gt; 
&lt;P&gt;address2&lt;/P&gt; 
&lt;P&gt;city&lt;/P&gt; 
&lt;P&gt;state&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The target collection has a unique integer value CustomerID which is used for the "query".&lt;/P&gt; 
&lt;P&gt;Under the document there is&lt;/P&gt; 
&lt;P&gt;rootTag&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp; data&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addresses (@class array)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row5 (object, loop element)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address1&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address2&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; city&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;with the obvious mapping.&lt;/P&gt; 
&lt;P&gt;This works fine... except when address2 is null ... I get the address2 output in Mongo as an 0 element array!&amp;nbsp; The advanced option "create empty element if needed" is not checked.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I want is either address2 being an empty string, or not having an address2 element if there is no address2 data.&amp;nbsp; I tried in a tMap to convert null to "", but got the same result.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:11:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222385#M16020</guid>
      <dc:creator>bglaplante</dc:creator>
      <dc:date>2024-11-16T06:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222386#M16021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; For testing purpose, could you please add single space " " and see whether it is resolving the issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt;
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 07:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222386#M16021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-02T07:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222387#M16022</link>
      <description>&lt;P&gt;Using the tMap to convert address2 to " " if null, the result in Mongo is now a string address2 and the content is a single space.&lt;/P&gt; 
&lt;P&gt;This is better than before, but I'd still prefer the field to be suppressed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm on Talend Open Studio Big Data 7.1.1&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 17:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222387#M16022</guid>
      <dc:creator>bglaplante</dc:creator>
      <dc:date>2019-04-02T17:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222388#M16023</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Could you please check whether you have selected "Remove Null Field" option in the mapping for tMongoDBOutput? If its checked, could you please uncheck it and try again?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 18:42:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222388#M16023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-02T18:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222389#M16024</link>
      <description>&lt;P&gt;I'm not sure where you see "Remove Null Field" in tMongoDBOutput.&amp;nbsp; I see "create empty element if needed" and that is NOT checked.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 20:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222389#M16024</guid>
      <dc:creator>bglaplante</dc:creator>
      <dc:date>2019-04-02T20:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222390#M16025</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Could you please select it and see whether data is getting created for empty elements?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt;
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 06:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222390#M16025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-03T06:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222391#M16026</link>
      <description>&lt;P&gt;Turning on or off the setting "create empty element if needed" seems to make no difference.&amp;nbsp; Results are the same either way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if the logic for creating (or not) is getting applied at the "row5" level, because that is an object?&amp;nbsp; So if there's anything for the object, the entire object is created, including address2.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 03:53:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222391#M16026</guid>
      <dc:creator>bglaplante</dc:creator>
      <dc:date>2019-04-04T03:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: tMongoDBOutput - getting null array when value is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222392#M16027</link>
      <description>&lt;P&gt;I am also facing this issue. Did you find solution to this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 13:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMongoDBOutput-getting-null-array-when-value-is-null/m-p/2222392#M16027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-17T13:53:41Z</dc:date>
    </item>
  </channel>
</rss>

