title: Unable to Understand the Document Size in Mongo Db
body: <p>I encountered a strange behavior of mongo and I would like to clarify it a bit. I wanted practically find out how many bytes does a single document consume when it has only one boolean attribute present in.</p>
  
  <p>Using Stackoverflow, I found out that I can use the following command</p>
  
  <p><b>Object.bsonsize</b> - some javascript method that should return a size in bytes</p>
  
  <p>While Executing these commands I got some results which is confusing. </p>
  
  <p>Here I provide with the steps I incorporated</p>
  
  <ol>
  <li><p>I Created a Database called <b>mydatabase</b> and stored a collection called <b>datarandom</b> which has one attribute called <b>status</b> and I have set it as <b>false</b>.It was assigned an <b>Object Id=558bf45d5ea9019aec35d7a2</b>. I ran the following query in RoboMongo</p>
  
  <pre><code>Object.bsonsize(db.datarandom.find( {"_id"  :ObjectId("558bf45d5ea9019aec35d7a2")})); 
  </code></pre>
  
  <p>I got <b>100 bytes</b>.</p></li>
  <li><p>I Ran the second Query on RoboMongo Which is as follows</p>
  
  <pre><code>Object.bsonsize(db.datarandom.findOne( {"_id" :ObjectId("558bf45d5ea9019aec35d7a2")})); 
  </code></pre>
  
  <p>I got the output as <b>31 bytes</b> only!!!!!!</p></li>
  </ol>
  
  <p>Can Somebody Explain why I am getting two different outputs when I use Find and FindOne when there is only one Document in my Collection with only boolean as an attribute. </p>