Closed
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
7.4.0
Node.js version
18.6.1
MongoDB server version
4.1.3
Typescript version (if applicable)
No response
Description
When using the mongoose.select() method I can only select to omit discriminator fields if _id
is also selected for ommision.
For example:
mongoose.select('-_id -__t') removes the __t field.
mongoose.select('-__t') does not.
This has been attempted using both array and string notation.
this may be related to #13679
Steps to Reproduce
- call
mongoose.select(['-__t'])
- console.log the result to see that
__t
is not removed from results.
Expected Behavior
__t
discriminator field should be removed via select method.