Skip to content

Commit

Permalink
Fix Typescript definition of schema.discriminator to allow strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachLeviPixel committed Oct 15, 2023
1 parent 236a7a7 commit 49f5296
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 49f5296

Please sign in to comment.