title: Mongodb returning wrong count
body: <p>I streamed data from a data file that is a few GB and imported into a Mongo collection. The file was zipped so I did  <code>zcat file.gz | mongoimport</code>  I know that I should be having 454229 documents in the collection. It was empty and the file has 454229 records. After the process, I tried a count and got 459680. I emptied the collection and repeated the process. Same result. Then I tried a distinct on the "_id" column, tried length, and got 454229. To makre sure no other process was changing the data, I tried count and distinct twice, distinct followed by count and then count followed by distinct.</p>
  
  <pre><code>rs1:PRIMARY&gt; db.amazon_xml_data.distinct("_id").length;
  454229
  rs1:PRIMARY&gt; db.amazon_xml_data.count({});
  459680
  rs1:PRIMARY&gt; db.amazon_xml_data.count({});
  459680
  rs1:PRIMARY&gt; db.amazon_xml_data.distinct("_id").length;
  454229
  </code></pre>
  
  <p>Mongo version is 3.2.22. I have this text at the end of the log file too...</p>
  
  <pre><code>amazon_xml_data 1.11GB
  2020-02-15T14:37:07.302+0530    imported 454229 documents    
  </code></pre>
  
  <p>So I am almost sure that the number returned by count is wrong.</p>