<?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>article Replicate - How to filter records by unique identifier &amp;quot;_id&amp;quot; in MongoDB source in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/ta-p/1921789</link>
    <description>&lt;P&gt;&lt;SPAN&gt;How to filter records by unique identifier "_id" in MongoDB source?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In MongoDB each document has a unique identifier field named "_id", it's generated automatically (by default). Replicate will replicate this field to target side. The field can be used to filter records.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By default the "_id" field was composed by 12 bytes. Below sample shows how to use the first 4 bytes to filter records.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;EM&gt;position&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;&lt;EM&gt;detailed explanation&lt;/EM&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;626509d4&lt;/FONT&gt;&lt;FONT color="#FFCC00"&gt;582db56b60&lt;/FONT&gt;&lt;FONT color="#999999"&gt;0232fb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#00CCFF"&gt;4 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;Representing the seconds since the Unix epoch&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#FFCC00"&gt;5 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;random value&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#999999"&gt;3 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;counter, starting with a random value&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 4 bytes are Hexadecimal value of Unix epoch seconds, it can be converted to meaningful time by the page:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="22.820785669947682%"&gt;Hex&lt;/TD&gt;
&lt;TD width="23.80582897342675%"&gt;Dec&lt;/TD&gt;
&lt;TD width="53.37338535662558%"&gt;&lt;A href="https://www.epochconverter.com/" target="_blank"&gt;https://www.epochconverter.com/&lt;/A&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.820785669947682%"&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;626509d4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="23.80582897342675%"&gt;1650788820&lt;/TD&gt;
&lt;TD width="53.37338535662558%"&gt;&lt;SPAN title="Sun Apr 24 2022 16:27:00 GMT+0800 (China Standard Time)"&gt;Sunday, April 24, 2022 4:27:00 PM&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="convert to other time zones" href="https://www.epochconverter.com/timezones?q=1650788820" target="_blank"&gt;GMT+08:00&lt;/A&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;H3 id="toc-hId-1969585815"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;All Supported &lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;#Version&lt;/LI&gt;
&lt;LI&gt;All Supported MongoDB versions (4.x)&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3 id="toc-hId-1969585815"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Detailed information&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Uses the "_id" in task filter, for example&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1650802795557.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77751i0F5C143B3D22405D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_0-1650802795557.png" alt="john_wang_0-1650802795557.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Apr 2022 12:25:04 GMT</pubDate>
    <dc:creator>john_wang</dc:creator>
    <dc:date>2022-04-24T12:25:04Z</dc:date>
    <item>
      <title>Replicate - How to filter records by unique identifier "_id" in MongoDB source</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/ta-p/1921789</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How to filter records by unique identifier "_id" in MongoDB source?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In MongoDB each document has a unique identifier field named "_id", it's generated automatically (by default). Replicate will replicate this field to target side. The field can be used to filter records.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By default the "_id" field was composed by 12 bytes. Below sample shows how to use the first 4 bytes to filter records.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;EM&gt;position&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;&lt;EM&gt;detailed explanation&lt;/EM&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;626509d4&lt;/FONT&gt;&lt;FONT color="#FFCC00"&gt;582db56b60&lt;/FONT&gt;&lt;FONT color="#999999"&gt;0232fb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#00CCFF"&gt;4 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;Representing the seconds since the Unix epoch&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#FFCC00"&gt;5 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;random value&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.486772486772495%" height="25px"&gt;&lt;FONT color="#999999"&gt;3 bytes&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="77.5132275132275%" height="25px"&gt;counter, starting with a random value&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 4 bytes are Hexadecimal value of Unix epoch seconds, it can be converted to meaningful time by the page:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="22.820785669947682%"&gt;Hex&lt;/TD&gt;
&lt;TD width="23.80582897342675%"&gt;Dec&lt;/TD&gt;
&lt;TD width="53.37338535662558%"&gt;&lt;A href="https://www.epochconverter.com/" target="_blank"&gt;https://www.epochconverter.com/&lt;/A&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="22.820785669947682%"&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;626509d4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="23.80582897342675%"&gt;1650788820&lt;/TD&gt;
&lt;TD width="53.37338535662558%"&gt;&lt;SPAN title="Sun Apr 24 2022 16:27:00 GMT+0800 (China Standard Time)"&gt;Sunday, April 24, 2022 4:27:00 PM&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="convert to other time zones" href="https://www.epochconverter.com/timezones?q=1650788820" target="_blank"&gt;GMT+08:00&lt;/A&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;H3 id="toc-hId-1969585815"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;All Supported &lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;#Version&lt;/LI&gt;
&lt;LI&gt;All Supported MongoDB versions (4.x)&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3 id="toc-hId-1969585815"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Detailed information&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Uses the "_id" in task filter, for example&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1650802795557.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77751i0F5C143B3D22405D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_0-1650802795557.png" alt="john_wang_0-1650802795557.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 12:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/ta-p/1921789</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2022-04-24T12:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate - How to filter records by unique identifier "_id" in MongoDB source</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/tac-p/1922392#M6298</link>
      <description>&lt;P&gt;John,&lt;/P&gt;
&lt;P&gt;Instead of epoch time in the filter, can we pass a dynamic string ?&lt;/P&gt;
&lt;P&gt;e.g:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Mongo to get last 10 days data,&lt;/P&gt;
&lt;P&gt;db.appraisalBM.count({_id:{$gte:ObjectId.fromDate(new Date(ISODate().setHours(00,00,00,00)-10*24*60*60000)), $lte:ObjectId.fromDate(new Date(ISODate().setHours(23,59,59,999)-2*24*60*60000))}})&lt;/P&gt;
&lt;P&gt;in QLIKReplicate can we do similar?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 01:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/tac-p/1922392#M6298</guid>
      <dc:creator>jyeragi</dc:creator>
      <dc:date>2022-04-26T01:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate - How to filter records by unique identifier "_id" in MongoDB source</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/tac-p/1932107#M6433</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164264"&gt;@jyeragi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Excuse me for the delay, I just missed your update.&lt;/P&gt;
&lt;P&gt;IN short I have not a better way at present.&lt;/P&gt;
&lt;P&gt;In SQLite it's easy to get the current date Julianday value eg&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;strftime('%s', 'now')&lt;/LI-CODE&gt;
&lt;P&gt;the output is decimal values like&amp;nbsp;1652842269 (means May 17 2022) however it's hard to transfer it to Hexadecimal value in SQLite to compare with _id value eg&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#00CCFF"&gt;626509d4&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;(Apr 24 2022).&lt;/P&gt;
&lt;P&gt;I will research it further. If I get any progress I will let you know.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 02:57:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Replicate-How-to-filter-records-by-unique-identifier-quot-id/tac-p/1932107#M6433</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2022-05-18T02:57:27Z</dc:date>
    </item>
  </channel>
</rss>

