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

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

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