lib/common/model.js
function (criteria) {
            var self = this;

            return this.needOne(criteria).then(function (target) {
                return self.destroy(target.id).then(function (documents) {
                    return documents[0];
                });
            });
        }
function (criteria) {
            var self = this;

            return this.needOne(criteria).then(function (target) {
                return self.destroy(target.id).then(function (documents) {
                    return documents[0];
                });
            });
        }
function ( criteria ) { var self = this ; return this . needOne ( criteria ) . then ( function ( target ) { return self . destroy ( target . id ) . then ( function ( documents ) { return documents [ 0 ] ; } ) ; } ) ; }
Destroy a single document by criteria and resolve it, otherwies
reject with a NotFoundError.
Destroy a single document by criteria and resolve it otherwies reject with a NotFoundError .