Replies: 1 comment
-
Added this to docs in 62ba207 👍 |
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
-
So today I had a problem with enums default failing message, I wanted to provide mine, but after searching whole docs found zero clue except using custom validators, but I felt that there should be something more easier syntax-wise, I found https://stackoverflow.com/questions/37403907/mongoose-model-custom-error-message-for-enums question, which pointed out that you can provide an object to
enum
property like below:where
values
is an array of values andmessage
is a string as any other validators likeunique
's second string in the array.I thought it would be wise to open an issue about that, but felt that it could something wider, that is why I'd liked to open this discussion.
So, is that something implicit? Like its doable because the nature of mongoose's schema?
If not, why there is no documentation about this?
Beta Was this translation helpful? Give feedback.
All reactions