-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
6.4.4
Node.js version
18.5.0
MongoDB server version
any
Description
Currently when using getters on a sub-schema and enabling toJSON: { getters: true } on the sub-schema, but not in the top-schema, they wont get added, unless the top-schema defines the nested schema as a array
Steps to Reproduce
Reproduction repository + branch: https://github.com/typegoose/typegoose-testing/tree/gettersNotCalled (follow the README#Setup)
Commit with the base example (not arrays): e013ce3f2d4c5827973753c2ef72f4655e7e9e33
Commit with the arrays: 06764561a634d15e791d391736874928d9b17169
Expected Behavior
To have the behavior consistent across both cases (either dont apply getters or apply getters in both cases)
Metadata
Metadata
Assignees
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.