mongoose model enum code example
Example: mongoose model enum
enum Role {
ADMIN = 'ADMIN',
USER = 'USER'
}
{
type: String,
enum: Role,
default: Role.USER,
}
enum Role {
ADMIN = 'ADMIN',
USER = 'USER'
}
{
type: String,
enum: Role,
default: Role.USER,
}