Comparing version 7.6.7 to 7.6.8
@@ -63,8 +63,2 @@ 'use strict'; | ||
this.driverChangeStream.on(ev, data => { | ||
// Sometimes Node driver still polls after close, so | ||
// avoid any uncaught exceptions due to closed change streams | ||
// See tests for gh-7022 | ||
if (ev === 'error' && this.closed) { | ||
return; | ||
} | ||
if (data != null && data.fullDocument != null && this.options && this.options.hydrate) { | ||
@@ -87,8 +81,2 @@ data.fullDocument = this.options.model.hydrate(data.fullDocument); | ||
this.driverChangeStream.on(ev, data => { | ||
// Sometimes Node driver still polls after close, so | ||
// avoid any uncaught exceptions due to closed change streams | ||
// See tests for gh-7022 | ||
if (ev === 'error' && this.closed) { | ||
return; | ||
} | ||
if (data != null && data.fullDocument != null && this.options && this.options.hydrate) { | ||
@@ -95,0 +83,0 @@ data.fullDocument = this.options.model.hydrate(data.fullDocument); |
@@ -19,6 +19,13 @@ 'use strict'; | ||
} | ||
if (schemaType._appliedDiscriminators) { | ||
continue; | ||
} | ||
for (const disc of schemaType.schema._applyDiscriminators.keys()) { | ||
schemaType.discriminator(disc, schemaType.schema._applyDiscriminators.get(disc)); | ||
schemaType.discriminator( | ||
disc, | ||
schemaType.schema._applyDiscriminators.get(disc) | ||
); | ||
} | ||
schemaType._appliedDiscriminators = true; | ||
} | ||
} |
'use strict'; | ||
const isNestedProjection = require('../projection/isNestedProjection'); | ||
module.exports = function applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip) { | ||
@@ -35,3 +37,3 @@ const paths = Object.keys(doc.$__schema.paths); | ||
const hasSubpaths = type.$isSingleNested || type.$isMongooseDocumentArray; | ||
if (curPath in fields || (j === len - 1 && hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[curPath])) { | ||
if ((curPath in fields && !isNestedProjection(fields[curPath])) || (j === len - 1 && hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[curPath])) { | ||
included = true; | ||
@@ -38,0 +40,0 @@ } else if (hasIncludedChildren != null && !hasIncludedChildren[curPath]) { |
@@ -24,2 +24,3 @@ 'use strict'; | ||
for (const key of keys) { | ||
if (key.indexOf('.') === -1) { | ||
@@ -26,0 +27,0 @@ hasIncludedChildren[key] = 1; |
@@ -185,3 +185,3 @@ 'use strict'; | ||
Subdocument.prototype.isModified = function(paths, modifiedPaths) { | ||
Subdocument.prototype.isModified = function(paths, options, modifiedPaths) { | ||
const parent = this.$parent(); | ||
@@ -196,6 +196,6 @@ if (parent != null) { | ||
return parent.$isModified(paths, modifiedPaths); | ||
return parent.$isModified(paths, options, modifiedPaths); | ||
} | ||
return Document.prototype.isModified.call(this, paths, modifiedPaths); | ||
return Document.prototype.isModified.call(this, paths, options, modifiedPaths); | ||
}; | ||
@@ -202,0 +202,0 @@ |
{ | ||
"name": "mongoose", | ||
"description": "Mongoose MongoDB ODM", | ||
"version": "7.6.7", | ||
"version": "7.6.8", | ||
"author": "Guillermo Rauch <guillermo@learnboost.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -181,4 +181,4 @@ declare module 'mongoose' { | ||
*/ | ||
isModified<T extends keyof DocType>(path?: T | Array<T>): boolean; | ||
isModified(path?: string | Array<string>): boolean; | ||
isModified<T extends keyof DocType>(path?: T | Array<T>, options?: { ignoreAtomics?: boolean } | null): boolean; | ||
isModified(path?: string | Array<string>, options?: { ignoreAtomics?: boolean } | null): boolean; | ||
@@ -185,0 +185,0 @@ /** Boolean flag specifying if the document is new. */ |
@@ -29,2 +29,4 @@ declare module 'mongoose' { | ||
throwOnValidationError?: boolean; | ||
strict?: boolean; | ||
timestamps?: boolean | 'throw'; | ||
} | ||
@@ -31,0 +33,0 @@ |
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
282
49565
2658620