Comparing version 8.5.0 to 8.5.1
@@ -144,4 +144,5 @@ 'use strict'; | ||
if (this.driverChangeStream) { | ||
this.driverChangeStream.close(); | ||
return this.driverChangeStream.close(); | ||
} | ||
return Promise.resolve(); | ||
} | ||
@@ -148,0 +149,0 @@ } |
@@ -5,5 +5,6 @@ 'use strict'; | ||
module.exports = function applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip) { | ||
module.exports = function applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip, options) { | ||
const paths = Object.keys(doc.$__schema.paths); | ||
const plen = paths.length; | ||
const skipParentChangeTracking = options && options.skipParentChangeTracking; | ||
@@ -84,3 +85,3 @@ for (let i = 0; i < plen; ++i) { | ||
doc_[piece] = def; | ||
applyChangeTracking(doc, p); | ||
applyChangeTracking(doc, p, skipParentChangeTracking); | ||
} | ||
@@ -98,3 +99,3 @@ } else if (included) { | ||
doc_[piece] = def; | ||
applyChangeTracking(doc, p); | ||
applyChangeTracking(doc, p, skipParentChangeTracking); | ||
} | ||
@@ -112,3 +113,3 @@ } | ||
doc_[piece] = def; | ||
applyChangeTracking(doc, p); | ||
applyChangeTracking(doc, p, skipParentChangeTracking); | ||
} | ||
@@ -127,7 +128,7 @@ } | ||
function applyChangeTracking(doc, fullPath) { | ||
function applyChangeTracking(doc, fullPath, skipParentChangeTracking) { | ||
doc.$__.activePaths.default(fullPath); | ||
if (doc.$isSubdocument && doc.$isSingleNested && doc.$parent() != null) { | ||
if (!skipParentChangeTracking && doc.$isSubdocument && doc.$isSingleNested && doc.$parent() != null) { | ||
doc.$parent().$__.activePaths.default(doc.$__pathRelativeToParent(fullPath)); | ||
} | ||
} |
{ | ||
"name": "mongoose", | ||
"description": "Mongoose MongoDB ODM", | ||
"version": "8.5.0", | ||
"version": "8.5.1", | ||
"author": "Guillermo Rauch <guillermo@learnboost.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2708342
51070