rudiment.js
function(index) {
      var that = this;

      var props = this._propIndex(index);
      if (!props) {
        return Promise.reject(new Error('No auto-indexing key specified'));
      }

      return this._dbApi.find(props).then(function(docs) {
        return that._readDoc(docs[0]);
      });
    }
function(index) {
      var that = this;

      var props = this._propIndex(index);
      if (!props) {
        return Promise.reject(new Error('No auto-indexing key specified'));
      }

      return this._dbApi.find(props).then(function(docs) {
        return that._readDoc(docs[0]);
      });
    }
function ( index ) { var that = this ; var props = this . _propIndex ( index ) ; if ( ! props ) { return Promise . reject ( new Error ( 'No auto-indexing key specified' ) ) ; } return this . _dbApi . find ( props ) . then ( function ( docs ) { return that . _readDoc ( docs [ 0 ] ) ; } ) ; }
Get a document from the database by auto-index

@param {Number|String} index
@return {Promise}
Get a document from the database by auto - index