Prerequisites
Mongoose version
8.16.2
Node.js version
22.16.0
MongoDB server version
7.0.21 Atlas
Typescript version (if applicable)
No response
Description
The #15501 PR introduced the ability to retrieve the _id and __v of a document from the ret parameter of the toObject/toJSON transform function. However, by doing so, the RawDocType is no longer accessible through the ret parameter, leading to a series of compilation errors when trying to access a document property, such as:
Steps to Reproduce
Try to access any document property over the ret parameter in the transform() function.
Expected Behavior
No response
Prerequisites
Mongoose version
8.16.2
Node.js version
22.16.0
MongoDB server version
7.0.21 Atlas
Typescript version (if applicable)
No response
Description
The #15501 PR introduced the ability to retrieve the
_idand__vof a document from theretparameter of the toObject/toJSON transform function. However, by doing so, theRawDocTypeis no longer accessible through the ret parameter, leading to a series of compilation errors when trying to access a document property, such as:Steps to Reproduce
Try to access any document property over the
retparameter in thetransform()function.Expected Behavior
No response