-
-
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
Breaking types of toObject
on SubDocument or ArraySubdocument
#14601
Milestone
Comments
In Mongoose 7, we recommend using
|
vkarpov15
added a commit
that referenced
this issue
May 30, 2024
types: pass DocType down to subdocuments so `HydratedSingleSubdocument` and `HydratedArraySubdocument` `toObject()` returns correct type
vkarpov15
added a commit
that referenced
this issue
Jun 5, 2024
…t` and `HydratedArraySubdocument` `toObject()` returns correct type Fix #14601
This was referenced Jun 22, 2024
This was referenced Jul 17, 2024
This was referenced Jul 18, 2024
This was referenced Jul 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.3.4
Node.js version
20
MongoDB server version
6.6
Typescript version (if applicable)
5.4.5
Description
Since Mongoose v7, the type of the results obtained by calling
toObject
on SubDocument or ArraySubdocument isany
. Prior to v7toObject
return type was working fine.Steps to Reproduce
** Code for version >=v7 **
** Code for version < v7 **
Expected Behavior
Both obj2 and obj3 should have proper types
The text was updated successfully, but these errors were encountered: