MongoDB / Mongoose: MarkModified a nested object

后端 未结 1 2350
忘了有多久
忘了有多久 2021-02-20 13:39

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:          


        
1条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-20 13:53

    You need to provide the full path the modified object field, so it should be:

    doc.markModified('email.data');
    

    0 讨论(0)
提交回复
热议问题