Skip to content

Commit

Permalink
Merge pull request #12447 from Tzvika-m/patch-1
Browse files Browse the repository at this point in the history
Add clarification about overwrite flag in model.js
  • Loading branch information
hasezoey committed Sep 22, 2022
2 parents 4495cf3 + 7d7fd96 commit 69c99d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2558,6 +2558,7 @@ Model.$where = function $where() {
* Model.findOneAndUpdate(query, { $set: { name: 'jason bourne' }}, options, callback)
*
* This helps prevent accidentally overwriting your document with `{ name: 'jason bourne' }`.
* To prevent this behaviour, see the `overwrite` option
*
* #### Note:
*
Expand Down Expand Up @@ -2690,6 +2691,7 @@ function _decorateUpdateWithVersionKey(update, options, versionKey) {
* Model.findByIdAndUpdate(id, { $set: { name: 'jason bourne' }}, options, callback)
*
* This helps prevent accidentally overwriting your document with `{ name: 'jason bourne' }`.
* To prevent this behaviour, see the `overwrite` option
*
* #### Note:
*
Expand Down

0 comments on commit 69c99d2

Please sign in to comment.