title: MongoDB Capped Collection not removing documents
body: <p>I wanted to cap a collection at 1MB or 300 records, whichever came first.</p>
  
  <pre><code>PRIMARY&gt;db.runCommand({"convertToCapped":"cache",'size':1024*1024, 'max':300});
  { "ok" : 1 }
  PRIMARY&gt;db.cache.isCapped();
  true
  </code></pre>
  
  <p>So far so good.
  A while later I check back in, after the collection has been used a bit (new records inserted, etc.)</p>
  
  <pre><code>PRIMARY&gt; db.cache.count();
  513
  </code></pre>
  
  <p>Um, what? Last time I checked, 513 > 300.
  Note that the "capping" was executed before the count exceeded 300.</p>
  
  <pre><code>PRIMARY&gt; db.cache.validate();
  {
  "ns" : "streamified.cache",
  "capped" : 1,
  "max" : 2147483647,
  "firstExtent" : "16:7279e000 ns:streamified..tmp.convertToCapped.cache",
  "lastExtent" : "16:7279e000 ns:streamified..tmp.convertToCapped.cache",
  "extentCount" : 1,
  "datasize" : 858104,
  "nrecords" : 513,
  "lastExtentSize" : 1052672,
  "padding" : 1,
  "firstExtentDetails" : {
      "loc" : "16:7279e000",
      "xnext" : "null",
      "xprev" : "null",
      "nsdiag" : "streamified..tmp.convertToCapped.cache",
      "size" : 1052672,
      "firstRecord" : "16:7279e0b0",
      "lastRecord" : "16:72871444"
  },
  "deletedCount" : 1,
  "deletedSize" : 186184,
  "nIndexes" : 0,
  "keysPerIndex" : {
  
  },
  "valid" : true,
  "errors" : [ ],
  "warning" : "Some checks omitted for speed. use {full:true} option to do more thorough scan.",
  "ok" : 1
  }
  </code></pre>
  
  <p>I'm not great at reading this output, but the "max" value above looks a bit weird. Other than that, I'm not sure what could be going wrong...</p>