How to update mongoose Schema after a day from one object to another object
I have a User Schema that has to object one for booking and seconde for history. after one day I want to push user booking data into history. how I can achieve this.
booking:[{
date: Date,
visitdate: Date,
slote: String,
msg: String,
doctor: {type: Schema.Types.ObjectId, ref: 'Doctor'}
}],
history:[{
date: Date,
expiredate: Date,
visitdate: Date,
slote: String,
msg: String,
doctor: {type: Schema.Types.ObjectId, ref: 'Doctor'}
}],