-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InferRawDocType not same type return from .lean() #14839
Comments
Is there somewhere in the Mongoose docs where it indicates that |
@vkarpov15
Tbh,I am not sure if it's just a bug or I misunderstood it either way thank you for your time |
Ah you're right, I misunderstood. We'll investigate. |
type(inferrawdoctype): infer Date types as JS dates rather than Mongoose SchemaType Date
Prerequisites
Mongoose version
8.5.3
Node.js version
19.8
MongoDB server version
7.0.12
Typescript version (if applicable)
No response
Description
when I use type returned by InferRawDocType it is supposed to be the same as the type returned from function .lean(), but using the document from
then()
it throws a type error, reproducsible code belowSteps to Reproduce
this code gives type error
Also whenever i use
user._id
it throws errorProperty '_id' does not exist on type '{ email: string; password: string; firstName: string; lastName: string; dateOfBirth: Date; }
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: