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

      return this.readByIndex(index).then(function(doc) {
        return that._updateDoc(doc, updates);
      });
    }
function(index, updates) {
      var that = this;

      return this.readByIndex(index).then(function(doc) {
        return that._updateDoc(doc, updates);
      });
    }
function ( index , updates ) { var that = this ; return this . readByIndex ( index ) . then ( function ( doc ) { return that . _updateDoc ( doc , updates ) ; } ) ; }
Update a document in the database by auto-index

@param {Number|String} index
@param {Object} updates - updates to apply to document
@return {Promise}
Update a document in the database by auto - index