Return-Types for Schema.prototype.discriminator
do not align with runtime behavior
#12457
Closed
2 tasks done
Labels
typescript
Types or Types-test related issue / Pull Request
Milestone
Prerequisites
Issue
Currently
Schema.prototype.discriminator
takes the discriminator schema as a argument (argument number 2 of 2) andthis
is the parent schema the discriminator schema is applied on and returnsthis
at the end.But the types currently imply that this function returns the discriminator schema (the schema from the argument):
Runtime:
mongoose/lib/schema.js
Lines 528 to 532 in 4495cf3
Types:
mongoose/types/index.d.ts
Line 198 in 4495cf3
The text was updated successfully, but these errors were encountered: