this is my schema and i want to set the role to enum
@Prop({ required: true }) name: string;
@Prop({ required: true }) email: string;
@Prop({ required: true }) password: string;
@Prop() role: string;
this is how i used to do in mongoose
role: {
type: String,
enum: roles,
default: 'user',
},
const roles = ['user', 'admin'];