From 35869a39fb5493fd813f2d24414e19c0fb1761d7 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sat, 11 Jul 2020 15:40:05 -0400 Subject: [PATCH] fix(document): clear out `priorDoc` after overwriting single nested subdoc so changes after overwrite get persisted correctly Fix #9208 --- lib/types/subdocument.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/types/subdocument.js b/lib/types/subdocument.js index 521237aee72..b015a091cf3 100644 --- a/lib/types/subdocument.js +++ b/lib/types/subdocument.js @@ -48,6 +48,8 @@ function Subdocument(value, fields, parent, skipId, options) { } } } + + delete options.priorDoc; } }