docs: function(opts) {
      var that = this;
      opts = opts || {};
  
      this._db = opts.db;
      if (!this._db) {
        throw new Error('No database provided');
      }
  
      this._dbType = getDbType(opts.db);
  
      if (!this._dbType) {
        throw new Error('Unknown database type');
      }
  
      this._schema = Array.isArray(opts.schema) ? opts.schema : (opts.schema ? [opts.schema] : []);
  
      // attempt to get props from the passed schema
      var schemaProps;
      if (this._schema[0] && this._schema[0].toJSON) {
        var obj = this._schema[0].toJSON();
        if (obj && obj.properties) {
          schemaProps = Object.keys(obj.properties);
        }
      }
  
      this._props = opts.props || schemaProps;
  
      this._key = opts.key;
      this._index = opts.index;
  
      this._uniq = [
        this._dbType.id,
        this._key,
        this._index
      ].concat(opts.uniq).filter(function(prop) {
        return prop;
      });
  
      this._in_map = mapOrSelf(opts.in);
      this._out_map = mapOrSelf(opts.out);
      this._path = opts.path;
  
      // allow the constructor to override any of the prototype methods
      Object.keys(Rudiment.prototype).forEach(function(method) {
        if (opts[method]) {
          that[method] = opts[method];
        }
      });
  
      this._dbApi = this._dbType.api;
      Object.keys(this._dbApi).forEach(function(dbApiFnName) {
        that._dbApi[dbApiFnName] = that._dbApi[dbApiFnName].bind(that);
      });
  
      this._init = this._dbApi.init();
    }