Mongoose -> Updating document from custom Schema method Mongoose -> Updating document from custom Schema method mongoose mongoose

Mongoose -> Updating document from custom Schema method


To anyone else who finds this question, the solution is related to the updated object being nested so the change is not detected by default. The solution in this case is to call

this.markModified('schedule')await this.save()

which should propagate the changes to the DB. The feature is documented here https://mongoosejs.com/docs/schematypes.html#mixed