<?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 TAmazonDocumentDBOuput how to delete by ObjectId in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/TAmazonDocumentDBOuput-how-to-delete-by-ObjectId/m-p/2485456#M141350</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to delete into DocumentDB collection some documents by _id. Some _id are string type but others are ObjectId type.&lt;/P&gt;
&lt;P&gt;I can delete _id with String type but I cannot remove the documents with ObjectId.&lt;/P&gt;
&lt;P&gt;Can you help me?&lt;/P&gt;
&lt;P&gt;I also tried to use MongoDB components to conntct DocumentDB database but Talend Studio append to find statement the noCursorTimeout method and DocumentDB not support this feature, find method fails.&lt;/P&gt;</description>
    <pubDate>Sat, 05 Oct 2024 11:08:25 GMT</pubDate>
    <dc:creator>fcolagiacomo</dc:creator>
    <dc:date>2024-10-05T11:08:25Z</dc:date>
    <item>
      <title>TAmazonDocumentDBOuput how to delete by ObjectId</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TAmazonDocumentDBOuput-how-to-delete-by-ObjectId/m-p/2485456#M141350</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to delete into DocumentDB collection some documents by _id. Some _id are string type but others are ObjectId type.&lt;/P&gt;
&lt;P&gt;I can delete _id with String type but I cannot remove the documents with ObjectId.&lt;/P&gt;
&lt;P&gt;Can you help me?&lt;/P&gt;
&lt;P&gt;I also tried to use MongoDB components to conntct DocumentDB database but Talend Studio append to find statement the noCursorTimeout method and DocumentDB not support this feature, find method fails.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Oct 2024 11:08:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TAmazonDocumentDBOuput-how-to-delete-by-ObjectId/m-p/2485456#M141350</guid>
      <dc:creator>fcolagiacomo</dc:creator>
      <dc:date>2024-10-05T11:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: TAmazonDocumentDBOuput how to delete by ObjectId</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TAmazonDocumentDBOuput-how-to-delete-by-ObjectId/m-p/2486617#M141393</link>
      <description>&lt;P&gt;&lt;EM&gt;Talend Amazon DocumentDB components are not functional:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;- Output executes data action one document for each element of flow, you cannot execute delete or update by query.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Anyway I found a workaround, it is not elegant but it could be save the life &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; :&lt;/P&gt;
&lt;P&gt;The solution is: to create the query below into tAmazonDocumentDBOutput:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;"{ $or: [{'_id': '"+globalMap.get("_id")+"'}, {'_id': ObjectId('"+globalMap.get("_id")+"')}]}"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Example of scenario:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Job has to delete all documents in a collection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;tAmazonDocumentDBInput --row1--&amp;gt; tJava --row2--&amp;gt; tAmazonDocumentDBOutput&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;tAmazonDocumentDBInput &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;field query: {}&lt;/P&gt;
&lt;P&gt;schema: _id type Object or String (there isn't any differeces!)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;tJava&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;globalMap.put("_id", row1._id)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;tAmazonDocumentDBOutput&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;schema: there shouldn't be a key field&lt;/P&gt;
&lt;P&gt;field query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;"{ $or: [{'_id': '"+globalMap.get("_id")+"'}, {'_id': ObjectId('"+globalMap.get("_id")+"')}]}"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;field Bulk write: unchecked (&lt;STRONG&gt;&lt;EM&gt;it is very important!&lt;/EM&gt;&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;field data action: Delete&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 07:25:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TAmazonDocumentDBOuput-how-to-delete-by-ObjectId/m-p/2486617#M141393</guid>
      <dc:creator>fcolagiacomo</dc:creator>
      <dc:date>2024-10-14T07:25:25Z</dc:date>
    </item>
  </channel>
</rss>

