<?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 Qlik Replicate: How to find MongoDB stream position in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-How-to-find-MongoDB-stream-position/ta-p/2545831</link>
    <description>&lt;P&gt;To start replication from a specific point in time on a &lt;FONT color="#339966"&gt;&lt;STRONG&gt;MongoDB&lt;/STRONG&gt; &lt;/FONT&gt;source, you will need to identify the &lt;STRONG&gt;&lt;FONT color="#339966"&gt;oplog stream position&lt;/FONT&gt;&lt;/STRONG&gt; (&lt;FONT color="#339966"&gt;&lt;STRONG&gt;BSON Timestamp&lt;/STRONG&gt;&lt;/FONT&gt;) corresponding to your target time and configure it in your Qlik Replicate task.&lt;/P&gt;
&lt;P&gt;This article outlines the options available to you.&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Prerequisites&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;The MongoDB oplog is a capped collection, and entries are overwritten over time. Ensure your target timestamp is still within the current oplog window before attempting to start from it.&lt;/LI&gt;
&lt;LI&gt;Query the primary node or a secondary with sufficient oplog retention.&lt;/LI&gt;
&lt;LI&gt;The Qlik Replicate MongoDB user requires read access to local.oplog.rs.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Finding the stream position&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option One: Query the oplog directly (Recommended)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;Connect to the primary node via mongosh and run:&lt;/P&gt;
&lt;PRE&gt;db.getSiblingDB('local').oplog.rs.find().sort({ $natural: -1 }).limit(1).pretty()&lt;/PRE&gt;
&lt;P&gt;This returns the most recent oplog entry. Look for the &lt;STRONG&gt;ts&lt;/STRONG&gt; field in the output:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"ts": Timestamp(1741600200, 1),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"op": "i",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;ts&lt;/STRONG&gt;&amp;nbsp;value is your stream position. The first number is Unix epoch seconds; the second is the ordinal increment.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Two: Query the oplog by target timestamp&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;If you know the specific time you want to start from, you can filter the oplog directly to find the closest entry:&lt;/P&gt;
&lt;PRE&gt;var t = new Timestamp(Math.floor(new Date("2026-03-10T11:30:00Z").getTime() / 1000), 1);&lt;BR /&gt;db.getSiblingDB('local').oplog.rs.find({ ts: { $gte: t } }).limit(1).pretty()&lt;/PRE&gt;
&lt;P&gt;Replace the date string with your target time. This returns the first oplog entry at or after that timestamp, giving you the exact &lt;STRONG&gt;ts&lt;/STRONG&gt; value to use.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Three: Use rs.status() for orientation&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The &lt;STRONG&gt;rs.status()&lt;/STRONG&gt; command returns the current replication position (optimeDate and optime.ts) for each replica set member:&lt;/P&gt;
&lt;PRE&gt;rs.status()&lt;/PRE&gt;
&lt;P&gt;This is useful for cross-referencing a wall-clock time to an approximate oplog position. Once you have an approximate position, use option two to pinpoint the exact &lt;STRONG&gt;ts&lt;/STRONG&gt; value.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Four: Let Qlik Replicate log it for you&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;Start the task normally (without specifying a position) and allow Qlik Replicate to connect to the MongoDB oplog. Qlik Replicate will log the current stream position it reads from in the task log output, in the exact format it expects. You can then use that as a reference and template for entering positions manually in future tasks.&lt;/P&gt;
&lt;P&gt;This is the safest way to confirm the correct position format for your version of Qlik Replicate before attempting a manual entry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configuring the stream position in Qlik Replicate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;Once you have your stream position value:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open your task and click the &lt;STRONG&gt;Run&lt;/STRONG&gt; drop-down &amp;gt; &lt;STRONG&gt;Advanced Run Options&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Under &lt;STRONG&gt;Tables are already loaded. Start processing changes from:&lt;/STRONG&gt;, select &lt;STRONG&gt;Source change position (e.g. SCN or LSN):&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Enter the stream position in the format Qlik Replicate expects&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Note: We recommend using option four first to confirm the exact position format your version of Qlik Replicate expects for MongoDB, as this can vary. Entering the value in an incorrect format will cause the task to start from an unintended position.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Replicate&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 01 Apr 2026 10:31:52 GMT</pubDate>
    <dc:creator>shashi_holla</dc:creator>
    <dc:date>2026-04-01T10:31:52Z</dc:date>
    <item>
      <title>Qlik Replicate: How to find MongoDB stream position</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-How-to-find-MongoDB-stream-position/ta-p/2545831</link>
      <description>&lt;P&gt;To start replication from a specific point in time on a &lt;FONT color="#339966"&gt;&lt;STRONG&gt;MongoDB&lt;/STRONG&gt; &lt;/FONT&gt;source, you will need to identify the &lt;STRONG&gt;&lt;FONT color="#339966"&gt;oplog stream position&lt;/FONT&gt;&lt;/STRONG&gt; (&lt;FONT color="#339966"&gt;&lt;STRONG&gt;BSON Timestamp&lt;/STRONG&gt;&lt;/FONT&gt;) corresponding to your target time and configure it in your Qlik Replicate task.&lt;/P&gt;
&lt;P&gt;This article outlines the options available to you.&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Prerequisites&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;The MongoDB oplog is a capped collection, and entries are overwritten over time. Ensure your target timestamp is still within the current oplog window before attempting to start from it.&lt;/LI&gt;
&lt;LI&gt;Query the primary node or a secondary with sufficient oplog retention.&lt;/LI&gt;
&lt;LI&gt;The Qlik Replicate MongoDB user requires read access to local.oplog.rs.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Finding the stream position&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option One: Query the oplog directly (Recommended)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;Connect to the primary node via mongosh and run:&lt;/P&gt;
&lt;PRE&gt;db.getSiblingDB('local').oplog.rs.find().sort({ $natural: -1 }).limit(1).pretty()&lt;/PRE&gt;
&lt;P&gt;This returns the most recent oplog entry. Look for the &lt;STRONG&gt;ts&lt;/STRONG&gt; field in the output:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"ts": Timestamp(1741600200, 1),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"op": "i",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;ts&lt;/STRONG&gt;&amp;nbsp;value is your stream position. The first number is Unix epoch seconds; the second is the ordinal increment.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Two: Query the oplog by target timestamp&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;If you know the specific time you want to start from, you can filter the oplog directly to find the closest entry:&lt;/P&gt;
&lt;PRE&gt;var t = new Timestamp(Math.floor(new Date("2026-03-10T11:30:00Z").getTime() / 1000), 1);&lt;BR /&gt;db.getSiblingDB('local').oplog.rs.find({ ts: { $gte: t } }).limit(1).pretty()&lt;/PRE&gt;
&lt;P&gt;Replace the date string with your target time. This returns the first oplog entry at or after that timestamp, giving you the exact &lt;STRONG&gt;ts&lt;/STRONG&gt; value to use.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Three: Use rs.status() for orientation&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The &lt;STRONG&gt;rs.status()&lt;/STRONG&gt; command returns the current replication position (optimeDate and optime.ts) for each replica set member:&lt;/P&gt;
&lt;PRE&gt;rs.status()&lt;/PRE&gt;
&lt;P&gt;This is useful for cross-referencing a wall-clock time to an approximate oplog position. Once you have an approximate position, use option two to pinpoint the exact &lt;STRONG&gt;ts&lt;/STRONG&gt; value.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Option Four: Let Qlik Replicate log it for you&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;Start the task normally (without specifying a position) and allow Qlik Replicate to connect to the MongoDB oplog. Qlik Replicate will log the current stream position it reads from in the task log output, in the exact format it expects. You can then use that as a reference and template for entering positions manually in future tasks.&lt;/P&gt;
&lt;P&gt;This is the safest way to confirm the correct position format for your version of Qlik Replicate before attempting a manual entry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configuring the stream position in Qlik Replicate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;Once you have your stream position value:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open your task and click the &lt;STRONG&gt;Run&lt;/STRONG&gt; drop-down &amp;gt; &lt;STRONG&gt;Advanced Run Options&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Under &lt;STRONG&gt;Tables are already loaded. Start processing changes from:&lt;/STRONG&gt;, select &lt;STRONG&gt;Source change position (e.g. SCN or LSN):&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Enter the stream position in the format Qlik Replicate expects&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Note: We recommend using option four first to confirm the exact position format your version of Qlik Replicate expects for MongoDB, as this can vary. Entering the value in an incorrect format will cause the task to start from an unintended position.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Replicate&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 01 Apr 2026 10:31:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-How-to-find-MongoDB-stream-position/ta-p/2545831</guid>
      <dc:creator>shashi_holla</dc:creator>
      <dc:date>2026-04-01T10:31:52Z</dc:date>
    </item>
  </channel>
</rss>

