With the given mongoose schema as example:
const projectSchema = new Schema({
mode: {
type: Number,
enum: {
values: [0,1,2,3]
message: "Values must be between 0 and 3"
},
default: 1,
required: [true, "Mode field is required"],
}
}
Is the required
field redundant since there is a default value already set, or could it be useful on specific situations?