Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
proof of concept for cleaning up dangling defaults on unmodified subd…
…ocuments re: #14722
  • Loading branch information
vkarpov15 committed Jul 5, 2024
commit c9f6591d9947eba1a9b09fff58b949e58e8bf12e
7 changes: 7 additions & 0 deletions lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,13 @@ Document.prototype.$__set = function(pathToMark, path, options, constructing, pa
}
});
}
} else if (schema && schema.instance === 'Embedded') {
const defaultPaths = Object.keys(this.$__.activePaths.states['default'] ?? {});
for (const defaultPath of defaultPaths) {
if (defaultPath.startsWith(path + '.')) {
this.$__.activePaths.clearPath(defaultPath);
}
}
}

let obj = this._doc;
Expand Down