[Typescript] Schema ref
property type declaration issue
#13672
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
typescript
Types or Types-test related issue / Pull Request
Prerequisites
Mongoose version
6.6.0
Node.js version
18.15.0
MongoDB server version
5.0.11
Typescript version (if applicable)
5.1.6
Description
There is an issue when defining cross-database ref in a Schema where the Model has TVirtuals type provided.
Steps to Reproduce
Expected Behavior
The
ref
type declaration should allow virtuals to be present in the Model type.I think modifying these 2 lines should be enough:
mongoose/types/schematypes.d.ts
Line 88 in 255493b
mongoose/types/schematypes.d.ts
Line 251 in 255493b
Not sure if this type could be inferred somewhere or if it should only be
Model<any, any, any, any>
.The text was updated successfully, but these errors were encountered: