Skip to content

Commit

Permalink
Merge pull request #7474 from arniu/fix-doc
Browse files Browse the repository at this point in the history
Fix doc
  • Loading branch information
vkarpov15 authored Feb 1, 2019
2 parents f67e30c + e91dbfe commit 1bfdafd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/middleware.jade
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ block content

```javascript
// Only document middleware
schema.pre('remove', { document: true } function() {
schema.pre('remove', { document: true }, function() {
console.log('Removing doc!');
});

// Only query middleware. This will get called when you do `Model.remove()`
// but not `doc.remove()`.
schema.pre('remove', { query: true } function() {
schema.pre('remove', { query: true }, function() {
console.log('Removing!');
});
```
Expand Down
6 changes: 3 additions & 3 deletions lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1516,11 +1516,11 @@ Document.prototype.$isDefault = function(path) {
*
* ####Example:
* product.remove(function (err, product) {
* product.isDeleted(); // true
* product.$isDeleted(); // true
* product.remove(); // no-op, doesn't send anything to the db
*
* product.isDeleted(false);
* product.isDeleted(); // false
* product.$isDeleted(false);
* product.$isDeleted(); // false
* product.remove(); // will execute a remove against the db
* })
*
Expand Down

0 comments on commit 1bfdafd

Please sign in to comment.