How to restrict additional properties in Mongoose with TypeScript and always return .toJSON property? #15185
Unanswered
gabrielgrs
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Is there a way to enforce that only the properties defined in my Mongoose schema are allowed? I want to prevent any extra properties from being accepted or saved. What's the best approach to achieve this?
And is there a way to always return the object as ".toJSON"?
Beta Was this translation helpful? Give feedback.
All reactions