Unfortunately I don't have a record I can test this on, but I can't find any information on this anywhere.
Say I have a document like this:
{
email: {
type: 'Gmail',
data: {//freeform data},
}
}
I want to update doc.email.data
. I need to use markModified()
or else the data won't save correctly.
Do I mark modified like this?
doc.email.data = newData;
doc.markModified('email.data');
doc.save();
Or do I just do markModified('email')
and Mongoose will work out the rest?