mongoose enum of collections code example
Example: enum in mongoose
var userSchema = new mongooseSchema({
userType: {
type: String,
enum : ['user','admin'],
default: 'user'
},
})
var userSchema = new mongooseSchema({
userType: {
type: String,
enum : ['user','admin'],
default: 'user'
},
})