code: function getType (obj, prop, self) {
    var val = obj[prop];
    var type = typeof val;
  
    if (null == val) {
      return 'null';
    }
  
    if (Buffer.isBuffer(val) || val instanceof mongodb.Binary) {
      return 'Binary';
    }
  
    if (Array.isArray(val)) {
      if (val.length > 0) {
        return getArrayType(val, self);
      }
      return [];
    }
  
    if (val instanceof mongodb.ObjectID) {
      return 'ObjectId';
    }
  
    if (val instanceof mongodb.Long) {
      return 'Long';
    }
  
    if (val instanceof mongodb.Double) {
      return 'Double';
    }
  
    if (val instanceof mongodb.Code) {
      return 'Code';
    }
  
    if (val instanceof mongodb.DBRef) {
      return 'DBRef';
    }
  
    if (val instanceof mongodb.Timestamp) {
      return 'Timestamp';
    }
  
    if (val instanceof mongodb.MinKey ||
        val instanceof mongodb.MaxKey) {
      return 'Mixed';
    }
  
    if (val instanceof mongodb.Symbol) {
      return 'Symbol';
    }
  
    if (val instanceof Date) {
      return 'Date';
    }
  
    if (val instanceof RegExp) {
      return 'RegExp';
    }
  
    val = val.valueOf();
    type = typeof val;
  
    if ('string' == type) {
      return 'String';
    }
  
    if ('number' == type) {
      return 'Number';
    }
  
    if ('boolean' == type) {
      return 'Boolean';
    }
  
    if ('object' != type) {
      throw new Error('dunno what to do with ' + val);
    }
  
    var ret = {};
    var keys = Object.keys(val);
  
    if (0 === keys.length) {
      return ret;
    }
  
    for (var i = 0; i < keys.length; ++i) {
      var key = keys[i];
      ret[key] = self.getType(val, key);
    }
  
    return ret;
  }
docs: Determines the type of obj[prop]