enum in javascript with mongoose 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'
},
})