You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
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 is any. Prior to v7 toObject return type was working fine.
In Mongoose 7, we recommend using HydratedSingleSubdocument and HydratedArraySubdocument rather than ISub & Types.Subdocument. With #14612, the following will no longer return any
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: