assigning value between two options in a mongoDB Schema

 we use enum to allocate value between two options

 status: { type: String, enum: ["draft", "published"], default: "draft" }

Comments