Skip to content

Commit

Permalink
fix findOneAndUpdate with { runValidators: true } options
Browse files Browse the repository at this point in the history
TypeError: Cannot read property '_update' of undefined
  • Loading branch information
fernandolguevara authored Sep 10, 2019
1 parent a4c3e10 commit 483c90a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -3543,10 +3543,10 @@ Query.prototype._findAndModify = function(type, callback) {
if (error) {
return callback(error);
}
_legacyFindAndModify.call(_this, castedQuery, this._update, opts, cb);
_legacyFindAndModify.call(_this, castedQuery, _this._update, opts, cb);
});
} else {
_legacyFindAndModify.call(_this, castedQuery, this._update, opts, cb);
_legacyFindAndModify.call(_this, castedQuery, _this._update, opts, cb);
}

return this;
Expand Down

0 comments on commit 483c90a

Please # to comment.