diff --git a/docs/middleware.jade b/docs/middleware.jade index c4f08eae66b..813c2d01f5e 100644 --- a/docs/middleware.jade +++ b/docs/middleware.jade @@ -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!'); }); ``` diff --git a/lib/document.js b/lib/document.js index 38f6f155e27..4c8f6995b9b 100644 --- a/lib/document.js +++ b/lib/document.js @@ -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 * }) *