Skip to content

Commit

Permalink
[docs] add example for issue #7803
Browse files Browse the repository at this point in the history
  • Loading branch information
Mangosteen-Yang committed Jul 26, 2019
1 parent cf938e2 commit beab87a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,11 @@ Schema.prototype.queue = function(name, args) {
* console.log(this.getFilter());
* });
*
* // Equivalent to calling `pre()` on `updateOne`, `findOneAndUpdate`.
* toySchema.pre(['updateOne', 'findOneAndUpdate'], function(next) {
* console.log(this.getFilter());
* });
*
* @param {String|RegExp} The method name or regular expression to match method name
* @param {Object} [options]
* @param {Boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware.
Expand Down

0 comments on commit beab87a

Please sign in to comment.