diff --git a/types/query.d.ts b/types/query.d.ts index 3145dfef477..f4463e3f95b 100644 --- a/types/query.d.ts +++ b/types/query.d.ts @@ -701,9 +701,10 @@ declare module 'mongoose' { ResultType extends HydratedDocument[] ? HydratedDocument[] : RawDocTypeOverride[] : - ResultType extends HydratedDocument ? - HydratedDocument : - RawDocTypeOverride + | (ResultType extends HydratedDocument + ? HydratedDocument + : RawDocTypeOverride) + | (null extends ResultType ? null : never) >, DocType, THelpers,