Create array of enums
See original GitHub issueCreating an array of enum doesn’t appear to be implemented, would be nice to have!
var mySchema = new Schema({
label: [{type:String, enum: ['enumVal1','enumVal2']}]
});
Small snippet of conversation on irc which might give direction:
aheckmann: file an issue, i think its b/c the validation isn't set on the array
Issue Analytics
- State:
- Created 12 years ago
- Comments:14
Top Results From Across the Web
How to create an array of enums - Stack Overflow
var enums = new Tuple<Enum1, Enum2>(Enum1.Value1, Enum2.AnotherValue); if (enums.Item1 == Enum1.Value1) ... ...but I wouldn ...
Read more >Convert an Enum to an Array of Objects in TypeScript
Use the Object.keys() method to get an array of the enum's keys. · Filter out the unnecessary values for numeric enums. · Use...
Read more >TypeScript - Enum to Array - DEV Community
I'll explain how to do that. Considering a key/value enum, you can use the Object.entries to extract the data and create the array....
Read more >Enum to Array of Enums VI - NI - National Instruments
array of enums returns an array containing each enum value in order. For example, if enum has values {cat, dog, bird}, array of...
Read more >Java Arrays and Enums - Marcus Biel
In episode 8 of my free Java Video Course I focus on arrays and enums. ... Let's say we wanted to create an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use something like
to set default value.
@cloud-tribal well the issue is closed with 3.9.6 as the milestone, so I’d imagine that means it was released in 3.9.6. If you’re using 4.x you should be able to access this feature.