Skip to content

Commit

Permalink
docs(document): elaborate on how Document#save works re Automattic#9001
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrahmanHafez committed May 15, 2020
1 parent dbdc417 commit e9c826c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/document.js
Expand Up @@ -2606,7 +2606,8 @@ Document.prototype.$markValid = function(path) {
};

/**
* Saves this document.
* Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`,
* or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation **only** with the modifications to the database, it does not replace the whole document in the latter case.
*
* ####Example:
*
Expand Down
3 changes: 2 additions & 1 deletion lib/model.js
Expand Up @@ -415,7 +415,8 @@ function generateVersionError(doc, modifiedPaths) {
}

/**
* Saves this document.
* Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`,
* or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation **only** with the modifications to the database, it does not replace the whole document in the latter case.
*
* ####Example:
*
Expand Down

0 comments on commit e9c826c

Please sign in to comment.