From f0dc26f945652124ebc1cb03f7a92660811440a8 Mon Sep 17 00:00:00 2001 From: Sean Derrow Date: Sun, 28 Apr 2024 04:36:47 -0400 Subject: [PATCH] Add `null` to `select` override return type --- types/query.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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,