enum type in 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'
},
})