We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14c9c44 commit fd94cd1Copy full SHA for fd94cd1
lib/schema.js
@@ -412,9 +412,8 @@ Schema.prototype._clone = function _clone(Constructor) {
412
s.s.hooks = this.s.hooks.clone();
413
414
s.tree = clone(this.tree);
415
- // recursion is triggered here
416
s.paths = Object.fromEntries(
417
- Object.entries(this.paths).map(([key, value]) => ([key, value.$isSingleNested ? value.clone() : value]))
+ Object.entries(this.paths).map(([key, value]) => ([key, !value.$isMongooseDocumentArray ? value.clone() : value]))
418
);
419
s.nested = clone(this.nested);
420
s.subpaths = clone(this.subpaths);
0 commit comments