Skip to content

Commit

Permalink
return from remove if no docs are found - fixes #75
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Aug 12, 2013
1 parent 9d26012 commit 96d5d0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Collection.prototype.remove = function() {

if (arguments.length > 1 && arguments[1] === true) { // the justOne parameter
this.findOne(arguments[0], function(err, doc) {
if (err) return callback(err);
if (err || !doc) return callback(err);
self._apply(DRIVER_COLLECTION_PROTO.remove, [doc, callback]);
});
return;
Expand Down

0 comments on commit 96d5d0b

Please sign in to comment.