this is my schema in mongoose
const companySchema = new mongoose.Schema({
country: {
type: String,
required: true
},
username: {
type: String,
unique: true,
required: true
},
password: {
type: String,
required: true
},
vaccine: [{
name: String,
price: Number,
availibility: Number,
needed: Number
}]
}, {
timestamps: true
});
I have created a form which gives the input for vaccine object(name price availability and needed) and its data is available in req.body. How do I append this using mongoose?