Skip to content

Commit

Permalink
Merge pull request #13979 from ZachLeviPixel/schema-discriminator-typ…
Browse files Browse the repository at this point in the history
…escript-type

Fix Typescript definition of schema.discriminator to allow strings.
  • Loading branch information
vkarpov15 authored Oct 17, 2023
2 parents 236a7a7 + 49f5296 commit bbe3a0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ declare module 'mongoose' {
/** Returns a copy of this schema */
clone<T = this>(): T;

discriminator<DisSchema = Schema>(name: string, schema: DisSchema): this;
discriminator<DisSchema = Schema>(name: string | number, schema: DisSchema): this;

/** Returns a new schema that has the picked `paths` from this schema. */
pick<T = this>(paths: string[], options?: SchemaOptions): T;
Expand Down

0 comments on commit bbe3a0b

Please sign in to comment.