Skip to content

Commit

Permalink
Merge pull request #12330 from lpizzinidev/fix-querymidtype
Browse files Browse the repository at this point in the history
Added findOneAndReplace and replaceOne to query middleware type
  • Loading branch information
AbdelrahmanHafez committed Aug 25, 2022
2 parents d914a94 + 60f5169 commit 1ed6723
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/middlewares.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare module 'mongoose' {

type MongooseDocumentMiddleware = 'validate' | 'save' | 'remove' | 'updateOne' | 'deleteOne' | 'init';
type MongooseQueryMiddleware = 'count' | 'deleteMany' | 'deleteOne' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndRemove' | 'findOneAndUpdate' | 'remove' | 'update' | 'updateOne' | 'updateMany';
type MongooseQueryMiddleware = 'count' | 'deleteMany' | 'deleteOne' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndRemove' | 'findOneAndReplace' | 'findOneAndUpdate' | 'remove' | 'replaceOne' | 'update' | 'updateOne' | 'updateMany';

type MiddlewareOptions = { document?: boolean, query?: boolean };
type SchemaPreOptions = MiddlewareOptions;
Expand Down

0 comments on commit 1ed6723

Please sign in to comment.