Q:

Unable to Understand the Document Size in Mongo Db

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.
Using Stackoverflow, I found out that I can use the following command
Object.bsonsize - some javascript method that should return a size in bytes
While Executing these commands I got some results which is confusing. 
Here I provide with the steps I incorporated

I Created a Database called mydatabase and stored a collection called datarandom which has one attribute called status and I have set it as false.It was assigned an Object Id=558bf45d5ea9019aec35d7a2. I ran the following query in RoboMongo
Object.bsonsize(db.datarandom.find( {"_id"  :ObjectId("558bf45d5ea9019aec35d7a2")})); 

I got 100 bytes.
I Ran the second Query on RoboMongo Which is as follows
Object.bsonsize(db.datarandom.findOne( {"_id" :ObjectId("558bf45d5ea9019aec35d7a2")})); 

I got the output as 31 bytes only!!!!!!

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. 

A:

There are multiples ways to find out the collection size or document size.
In your scenario you inserted only one document with one field status, So two fields in one document _id and status
Use the following command
 use mydatabase  //To use particular database

 db.datarandom.stats() //Returns information of datarandom collection

Size gives the documents size
Count gives no of documents, etc.
More details about the collection stats link
Edit
Note:
find - which returns cursor object
Note: Cursor- A pointer to the result set of a query.
findOne - returns particular document, So its gives perfect size of the document without padding space while using with db.bsonsize.
 collection.stats() - Which returns details about the collection, size field gives the document size including padding space.
Note: Every document in MongoDB is stored in a record which contains the document itself and extra space, or padding. Padding allows the document to grow as the result of updates while minimizing the likelihood of reallocations.
Check for storage characteristics
Big Note
Even though you have only one document or many, find and findone behavior won't change.
First understand where to use what.
One question for you
For example:
   [{status: true}] and {status :true} 

is same?
whether it gives same size?

