VolSchema = mongoose.Schema({
reference : { type : String , unique : true , required : true } ,
open : Boolean ,
close : Boolean ,
dateDepart : Date ,
Depart :{ type: mongoose.Schema.Types.ObjectId, ref: ‘Gare’ },
Arrivee : { type: mongoose.Schema.Types.ObjectId, ref: ‘Gare’ },
inStation : Boolean,
inRoute : Boolean ,
tempsfixvalue : Boolean ,
relatedTickets : {
type: [{roomId : String, id : String , passenger : String , quantite : Number , price : mongoose.Decimal128 , confirmer : Boolean }],
default : []
}
}, {
timestamps: true
})
example :
Vol = {
…… ,
relatedTickets : [
{roomId : “123” , id : 1 , passenger : “Tayeb” , quantite : 2 , price : 12.00 , confirmer : false},
{roomId : “1223” , id : 2 , passenger : “Omar” , quantite : 1 , price : 12.00 , confirmer : true},
]
}
I want to update confirmer of first relatedTickets to true
I want the ansure of my queston
Tayeb Masssaoudi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.