how to use enum in mongoose and create table 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'
},
})