InferRawDocType returns unknown
for every property instead of the right type
#14658
Closed
1 task done
Labels
help wanted
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Stale
Prerequisites
Mongoose version
8.4.x
Node.js version
20.x
MongoDB version
7.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.7.x
Issue
Hello!
Following the documentation regarding
InferRawDocType
I'm facing a weird typing issue: every property of my schema is defined asunknown
.I'm using NestJS Mongoose Schema, could it be the problem?
My goal is to share the same type definition between my backend and frontend app.
I can't use the decorated class
User
on the frontend so I'm trying to get an inferred type that I can use on both.Here's the code:
Here's what
UserType
gives:Any idea as to why the properties aren't typed correctly?
Thanks!
The text was updated successfully, but these errors were encountered: