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

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      return this.readByKey(key).then(function(doc) {
        return that.delete(doc[that._dbType.id]);
      });
    }
function(key) {
      var that = this;

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      return this.readByKey(key).then(function(doc) {
        return that.delete(doc[that._dbType.id]);
      });
    }
function ( key ) { var that = this ; if ( ! this . _key || ! key ) { return Promise . reject ( new Error ( 'No unique key specified' ) ) ; } return this . readByKey ( key ) . then ( function ( doc ) { return that . delete ( doc [ that . _dbType . id ] ) ; } ) ; }
Delete a document from the database by key

@param {String} key
@return {Promise}
Delete a document from the database by key