<?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 MongoDB Collection update in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236482#M25178</link>
    <description>&lt;P&gt;I am fairly new to Talend and working on a POC.&lt;/P&gt; 
&lt;P&gt;I want to append a portion of mongo field-value to an existing document via Talend job. Currently I am using tMongoDBInput ----iterate--&amp;gt;&amp;gt; tJavaRow --&amp;gt; tMongoDBOutput&lt;/P&gt; 
&lt;P&gt;MongoDBInput reads the following field:&lt;/P&gt; 
&lt;P&gt;"TRIPLE" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "1395633600000" : "160.182",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "1395720000000" : "170.343"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt; 
&lt;P&gt;I want to add more values to this collection and store it back to the same document, but my flow doesn't add the values to the collection. What is the best approach for my use case?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is my tJavaRow code snippet:&lt;/P&gt; 
&lt;P&gt;Map&amp;lt;String, String&amp;gt; tripleMap = (Map)input_row.TRIPLE;&lt;BR /&gt;Map&amp;lt;String, String&amp;gt; dataTripleMap = (Map)globalMap.get("triple");&lt;BR /&gt;TreeMap&amp;lt;String, String&amp;gt; tMap = new TreeMap();&lt;BR /&gt;tMap.putAll(tripleMap);&lt;BR /&gt;tMap.putAll(dataTripleMap);&lt;BR /&gt;output_row.TRIPLE = tMap;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:32:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T07:32:27Z</dc:date>
    <item>
      <title>MongoDB Collection update</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236482#M25178</link>
      <description>&lt;P&gt;I am fairly new to Talend and working on a POC.&lt;/P&gt; 
&lt;P&gt;I want to append a portion of mongo field-value to an existing document via Talend job. Currently I am using tMongoDBInput ----iterate--&amp;gt;&amp;gt; tJavaRow --&amp;gt; tMongoDBOutput&lt;/P&gt; 
&lt;P&gt;MongoDBInput reads the following field:&lt;/P&gt; 
&lt;P&gt;"TRIPLE" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "1395633600000" : "160.182",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "1395720000000" : "170.343"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt; 
&lt;P&gt;I want to add more values to this collection and store it back to the same document, but my flow doesn't add the values to the collection. What is the best approach for my use case?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is my tJavaRow code snippet:&lt;/P&gt; 
&lt;P&gt;Map&amp;lt;String, String&amp;gt; tripleMap = (Map)input_row.TRIPLE;&lt;BR /&gt;Map&amp;lt;String, String&amp;gt; dataTripleMap = (Map)globalMap.get("triple");&lt;BR /&gt;TreeMap&amp;lt;String, String&amp;gt; tMap = new TreeMap();&lt;BR /&gt;tMap.putAll(tripleMap);&lt;BR /&gt;tMap.putAll(dataTripleMap);&lt;BR /&gt;output_row.TRIPLE = tMap;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236482#M25178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: MongoDB Collection update</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236483#M25179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;Do you want to&lt;SPAN&gt; update particular element in existing document instead of update the whole document? For the update document in MongoDB, Talend have the component called tMongoDBRow.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Sabrina&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 08:03:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236483#M25179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-16T08:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: MongoDB Collection update</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236484#M25180</link>
      <description>&lt;P&gt;That's correct. I want to update specific fields and not all, in the Mongo document. An update could be something like this:&lt;BR /&gt;&lt;BR /&gt;Original document:&lt;BR /&gt;{&lt;BR /&gt;"created": ISODate("2018-10-04T14:22:55.527Z"),&lt;BR /&gt;"modified": ISODate("2018-10-04T14:22:55.527Z"),&lt;BR /&gt;"TRIPLE" : {&lt;BR /&gt;"1395633600000" : "160.182",&lt;BR /&gt;"1395720000000" : "170.343"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Updated document:&lt;BR /&gt;{&lt;BR /&gt;"created": ISODate("2018-10-04T14:22:55.527Z"),&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;U&gt;"modified": ISODate("2018-10-16T16:19:25.327Z")&lt;/U&gt;,&lt;/FONT&gt;&lt;BR /&gt;"TRIPLE" : {&lt;BR /&gt;"1395633600000" : "160.182",&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;U&gt;"1395689700000" : "155.820",&lt;/U&gt;&lt;/FONT&gt;&lt;BR /&gt;"1395720000000" : "170.343"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The highlighted/underlined fields are modified as part of tMongoDBOutput with 'upsert with set' option.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 16:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MongoDB-Collection-update/m-p/2236484#M25180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-16T16:38:43Z</dc:date>
    </item>
  </channel>
</rss>

