diff --git a/lib/document.js b/lib/document.js index b5f949b2fa5..8a9149ebbe9 100644 --- a/lib/document.js +++ b/lib/document.js @@ -4130,6 +4130,14 @@ function applyVirtuals(self, json, options, toObjectOptions) { } assignPath = path.substring(options.path.length + 1); } + if (assignPath.indexOf('.') === -1 && assignPath === path) { + v = clone(self.get(path, options ? { ...options, noDottedPath: true } : { noDottedPath: true })); + if (v === void 0) { + continue; + } + json[assignPath] = v; + continue; + } const parts = assignPath.split('.'); v = clone(self.get(path), options); if (v === void 0) {