<?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: Unable to Parse MongoDB JSON with Arrays in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221509#M15486</link>
    <description>&lt;P&gt;Hi Sabrina,&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Job Screenshot" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M06g.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148818i8CB0BC4B84180A8A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M06g.jpg" alt="0683p000009M06g.jpg" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job Screenshot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I'm getting it through tMongoDBInput, Yes I've tried extracting it through extractJSON but its giving me error.&lt;/P&gt; 
&lt;P&gt;Please find below screenshot of my job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm using $lookup aggregation stage in tMongoDBInput, which is nothing but Left Outer Join in terms of RDBMS, it returns me all the matched documents&amp;nbsp;from the&amp;nbsp;lookup table as an array which&amp;nbsp;is empl in my case.&lt;/P&gt; 
&lt;P&gt;I'm able to parse through&amp;nbsp;all the fields of Main table&amp;nbsp;in tMongoDbInput, but because empl is an array of JSONS, I separate it out as a separate output using tMap.&lt;/P&gt; 
&lt;P&gt;I use tJavarow to add &lt;EM&gt;{"Response":&lt;/EM&gt;&amp;nbsp;at the start of the message and &lt;EM&gt;}&lt;/EM&gt; at the end (as it looses) it while coming out of tMongoDBInput.&lt;/P&gt; 
&lt;P&gt;So after all this I have the below JSON:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;{"Response":[ &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{ "_id" : { "$oid" : "5baad12cbe17f45d9c6797f7"} , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"emp_no" : 10001 , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"dept" : "d005" , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Start_Date" : { "$date" : "1986-06-26T05:00:00.000Z"} , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"End_Date" : { "$date" : "9999-01-01T06:00:00.000Z"}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}]}&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;Which I pass to tExtractJSONFields with below config:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="extractJsonSCRShot.JPG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M06q.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136075i26E3C6BC796EFC6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M06q.jpg" alt="0683p000009M06q.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;But I get below error:&lt;/P&gt; 
&lt;P&gt;Error on line 1 of document&amp;nbsp; : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I Hope I was able to clear all the doubts.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks and Regards,&lt;/P&gt; 
&lt;P&gt;Apoorv Jain&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 16:47:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-28T16:47:23Z</dc:date>
    <item>
      <title>Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221507#M15484</link>
      <description>&lt;P&gt;I get the below JSON as response to my Aggregation Query in tMongoInput.&lt;/P&gt; 
&lt;P&gt;I'm not able to access the values in the empl array, Can anybody please help me with this.&lt;/P&gt; 
&lt;P&gt;{&lt;BR /&gt;"_id" : {"$oid" : "5baac277be17f463df8a3c0d"},&lt;BR /&gt;"emp_no" : 10001,&lt;BR /&gt;"Salary" : 88958,&lt;BR /&gt;"Start_Date" : {"$date" : "2002-06-22T05:00:00Z"},&lt;BR /&gt;"End_Date" : {"$date" : "9999-01-01T06:00:00Z"},&lt;BR /&gt;"empl" : [ {&lt;BR /&gt;"_id" : {"$oid" : "5baad12cbe17f45d9c6797f7"},&lt;BR /&gt;"emp_no" : 10001,&lt;BR /&gt;"dept" : "d005",&lt;BR /&gt;"Start_Date" : {"$date" : "1986-06-26T05:00:00Z"},&lt;BR /&gt;"End_Date" : {"$date" : "9999-01-01T06:00:00Z"} }&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;Thanks and Regards,&lt;/P&gt; 
&lt;P&gt;Apoorv Jain&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221507#M15484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221508#M15485</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Where does your JSON response come from? tRestClient? Have you tried to access values by using tExtractJsonField component?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 08:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221508#M15485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-28T08:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221509#M15486</link>
      <description>&lt;P&gt;Hi Sabrina,&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Job Screenshot" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M06g.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148818i8CB0BC4B84180A8A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M06g.jpg" alt="0683p000009M06g.jpg" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Job Screenshot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I'm getting it through tMongoDBInput, Yes I've tried extracting it through extractJSON but its giving me error.&lt;/P&gt; 
&lt;P&gt;Please find below screenshot of my job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm using $lookup aggregation stage in tMongoDBInput, which is nothing but Left Outer Join in terms of RDBMS, it returns me all the matched documents&amp;nbsp;from the&amp;nbsp;lookup table as an array which&amp;nbsp;is empl in my case.&lt;/P&gt; 
&lt;P&gt;I'm able to parse through&amp;nbsp;all the fields of Main table&amp;nbsp;in tMongoDbInput, but because empl is an array of JSONS, I separate it out as a separate output using tMap.&lt;/P&gt; 
&lt;P&gt;I use tJavarow to add &lt;EM&gt;{"Response":&lt;/EM&gt;&amp;nbsp;at the start of the message and &lt;EM&gt;}&lt;/EM&gt; at the end (as it looses) it while coming out of tMongoDBInput.&lt;/P&gt; 
&lt;P&gt;So after all this I have the below JSON:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;EM&gt;{"Response":[ &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{ "_id" : { "$oid" : "5baad12cbe17f45d9c6797f7"} , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"emp_no" : 10001 , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"dept" : "d005" , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Start_Date" : { "$date" : "1986-06-26T05:00:00.000Z"} , &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"End_Date" : { "$date" : "9999-01-01T06:00:00.000Z"}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}]}&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;Which I pass to tExtractJSONFields with below config:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="extractJsonSCRShot.JPG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M06q.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136075i26E3C6BC796EFC6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M06q.jpg" alt="0683p000009M06q.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;But I get below error:&lt;/P&gt; 
&lt;P&gt;Error on line 1 of document&amp;nbsp; : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I Hope I was able to clear all the doubts.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks and Regards,&lt;/P&gt; 
&lt;P&gt;Apoorv Jain&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 16:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221509#M15486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-28T16:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221510#M15487</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&amp;nbsp;Any more insights on this?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 17:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221510#M15487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-01T17:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221511#M15488</link>
      <description>Can anybody please help me with this??</description>
      <pubDate>Wed, 03 Oct 2018 22:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221511#M15488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T22:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221512#M15489</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;Sorry for our silence. We do our best to answer as many posts as possible.&lt;/P&gt; 
&lt;P&gt;Is there any JSON fields that start with a number? If so, could you please try to put a tReplace in before the tExtractJSONFields?&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 06:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221512#M15489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-06T06:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Parse MongoDB JSON with Arrays</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221513#M15490</link>
      <description>&lt;P&gt;Can you let me know how to represent array in parent node on mongodboutput component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I want output has mentoined below&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;{&lt;BR /&gt;"_id" : ObjectId("5e995cd93e586c1b302cfbd3"),&lt;BR /&gt;"claimId" : 7142,&lt;BR /&gt;"patientId" : 88229,&lt;BR /&gt;"patientLastName" : "TEST",&lt;BR /&gt;"patientFirstName" : "GARY",&lt;BR /&gt;"patientMiddleInitial" : "A",&lt;BR /&gt;"details" :[&lt;/P&gt; 
&lt;P&gt;{"patientSex" : "MALE"&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;],&lt;BR /&gt;"patientDob" : "1950-04-13"&lt;BR /&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LyJu"&gt;Array.PNG&lt;/A&gt;</description>
      <pubDate>Fri, 17 Apr 2020 08:53:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-Parse-MongoDB-JSON-with-Arrays/m-p/2221513#M15490</guid>
      <dc:creator>kanuparthy</dc:creator>
      <dc:date>2020-04-17T08:53:12Z</dc:date>
    </item>
  </channel>
</rss>

