title: nodejs + mongoose - get the document size without querying all its content?
body: <p>Is it possible to get a document size before updating or adding data into it?</p>
  
  <p>I am using this package to count a doc size:</p>
  
  <pre><code>// Get BSON parser class.
  // https://www.npmjs.com/package/bson
  var bson = require("bson");
  // Create a bson parser instance.
  var BSON = new bson();
  </code></pre>
  
  <p>And this is my example code:</p>
  
  <pre><code>var docSize = 0;
  Piece.findOne({
     _id: lastPiece._id
  }, function(err, piece) {
  
      // Get the document size.
      docSize = BSON.calculateObjectSize(piece);
      // do something.
  })
  .select("-data");
  </code></pre>
  
  <p>But the docSize I get in there is <strong>not</strong> correct because I <strong>single out</strong> <code>data</code> from the query. <code>data</code> is the field that takes up lots of doc size, and that I don't want to query it becos I don't need it in certain cases, like this above.</p>
  
  <p>So is there anyway to know a doc size without querying the content of a doc?</p>