I'm trying to figure out how to best design a Schema base on the value of a checkbox:
var weatherSchema = mongoose.Schema({
day: Date,
minTtemperature: Number,
maxTemperature: Number,
snowy: Boolean,
amountOfSnow: Number,
snowAttribute2: String,
snowAttribute3: String
})
What i want to accomplish is to fill Snow attributes only in days where snowy value is True.
I've explored discriminators but I think this option is only helpful when I want to add different attributes or schema fields based on the value of an input. I'll really appreciate any help.