I tried to setup the query like this:
const dbRecord = await SomeModel.findOne({ _id: id });
if (newVal !== oldVal) {
dbRecord.someArray.oldValue = newValue;
dbRecord.someArray.updateArray.push(new Date())
}
// ...setting some more properties here
dbRecord.save()
Not sure if it’s inherently wrong, but it works for all properties, except the nested ones.