I checked the previous examples but couldn't find any ideas. Programming means don't repeat yourself, and I want create a model , but I didn't understand how to do it, I would like to apply it to the example below. thanks
const mongoose = require('mongoose');
const fasiSchema = mongoose.Schema({
controlloMateriale : {
tempoaSchedaInOre: { type: Date, required: false },
tempoTotaleInOre: { type: Date, required: false }
},
equipaggiamento : {
tempoaSchedaInOre: { type: Date, required: false },
tempoTotaleInOre: { type: Date, required: false }
},
});
mongoose.model('fasi',fasiSchema);