title: MongoDB bulkWrite() and stale reads
body: <p>Immediately after inserting documents using <code>db.collection.bulkWrite()</code> a query using the aggregate framework can often be stale (i.e. not all the 'inserted' documents are returned). Performing this exact same read immediately again could then return all the documents. Sometimes all the documents are returned first time and sometimes it can take 3 reads - there isn't any consistency to this.</p>
  
  <p>I am doing this on my local MongoDB 3.2 instance (no sharding whatsoever - only a primary) with WriteConcern set to W1 (i.e. the write must be acknowledged on my only instance).</p>
  
  <p>The profile on the insert:</p>
  
  <p><a href="https://i.stack.imgur.com/zemkX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zemkX.png" alt="Profile"></a></p>
  
  <p>The profile on the query:</p>
  
  <p><a href="https://i.stack.imgur.com/To684.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/To684.png" alt="Profile"></a></p>
  
  <p>What could possibly be happening?</p>