lib/stream.js
function(value) {
    var T;
    if (value && value._bsontype) {
      T = value._bsontype;
    } else {
      T = Object.prototype.toString.call(value).replace(/\[object (\w+)\]/, '$1');
    }
    if (T === 'Object') {
      T = 'Document';
    }
    return T;
  }
function(value) {
    var T;
    if (value && value._bsontype) {
      T = value._bsontype;
    } else {
      T = Object.prototype.toString.call(value).replace(/\[object (\w+)\]/, '$1');
    }
    if (T === 'Object') {
      T = 'Document';
    }
    return T;
  }
function ( value ) { var T ; if ( value && value . _bsontype ) { T = value . _bsontype ; } else { T = Object . prototype . toString . call ( value ) . replace ( / \[object (\w+)\] / , '$1' ) ; } if ( T === 'Object' ) { T = 'Document' ; } return T ; }
Returns the type of value as a string. BSON type aware. Replaces `Object`
with `Document` to avoid naming conflicts with javascript Objects.

@param  {Any} value   value for which to get the type
@param  {Any} path    path (in dot notation) for which to get the type
@return {String}      type as string, e.g. `ObjectId`, `Document`, `Date`,
`Number`, `Undefined`, `Boolean`, ...
Returns the type of value as a string . BSON type aware . Replaces Object with Document to avoid naming conflicts with javascript Objects .