-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum support on array of array #7926
Comments
As a workaround, you can do: people: {
type: [[{ type: String, enum: ['manager', 'student'] }]]
}, |
This ended up being much trickier than I thought because my workaround from my original comment doesn't actually work right now. Looks like validators on nested arrays were broken. We'll need to prioritize some refactoring work on nested arrays like #6405 |
Thanks for updating. I will write a |
Yep, once 5.6.7 is released 👍 |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
Throw an Error:
Error:
enum
can only be set on an array of strings, not ArrayWhat is the expected behavior?
check each string like array of string
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node 12.0
Mongoose 5.6.1
MongoDB 4.1.0
The text was updated successfully, but these errors were encountered: