Skip to content

Commit

Permalink
Merge pull request #10054 from coro101/add-discriminator-type
Browse files Browse the repository at this point in the history
fix(index.d.ts): add a missing type for discriminator
  • Loading branch information
vkarpov15 committed Mar 24, 2021
2 parents 80245ed + 6d00af2 commit 1c20044
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ declare module 'mongoose' {

/** Adds a discriminator type. */
discriminator<D extends Document>(name: string, schema: Schema, value?: string): Model<D>;
discriminator<T extends Document, U extends Model<T>>(name: string, schema: Schema<T, U>, value?: string): U;

/** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */
distinct(field: string, filter?: FilterQuery<T>, callback?: (err: any, count: number) => void): QueryWithHelpers<Array<any>, T, TQueryHelpers>;
Expand Down

0 comments on commit 1c20044

Please sign in to comment.