code: function(obj) {
      _.forEach(obj, function(val, key) {
        if (val && _.isFunction(val.toHexString)) {
          obj[key] = val.toHexString();
        } else if (_.isDate(val)) {
          obj[key] = val;
        } else if (_.isObject(val)) {
          if (val['$oid']) {
            obj[key] = val['$oid'];
          } else {
            obj[key] = this.uncast(val);
          }
        }
      }.bind(this));
  
      return obj;
    }
docs: Automatically uncast ObjectId to HexString Will mutate the original object obj can be an object or an array