diff --git a/types/index.d.ts b/types/index.d.ts index f38324417a9..3f94524ba98 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -260,7 +260,7 @@ declare module 'mongoose' { /** Returns a copy of this schema */ clone(): T; - discriminator(name: string, schema: DisSchema): this; + discriminator(name: string | number, schema: DisSchema): this; /** Returns a new schema that has the picked `paths` from this schema. */ pick(paths: string[], options?: SchemaOptions): T;