Comparing version 7.5.3 to 7.5.4
@@ -37,3 +37,3 @@ /*! | ||
function QueryCursor(query, options) { | ||
function QueryCursor(query) { | ||
// set autoDestroy=true because on node 12 it's by default false | ||
@@ -50,3 +50,3 @@ // gh-10902 need autoDestroy to destroy correctly and emit 'close' event | ||
this.model = model; | ||
this.options = options || {}; | ||
this.options = {}; | ||
model.hooks.execPre('find', query, (err) => { | ||
@@ -75,5 +75,6 @@ if (err != null) { | ||
} | ||
Object.assign(this.options, query._optionsForExec()); | ||
this._transforms = this._transforms.concat(query._transforms.slice()); | ||
if (this.options.transform) { | ||
this._transforms.push(options.transform); | ||
this._transforms.push(this.options.transform); | ||
} | ||
@@ -83,9 +84,6 @@ // Re: gh-8039, you need to set the `cursor.batchSize` option, top-level | ||
if (this.options.batchSize) { | ||
this.options.cursor = options.cursor || {}; | ||
this.options.cursor.batchSize = options.batchSize; | ||
// Max out the number of documents we'll populate in parallel at 5000. | ||
this.options._populateBatchSize = Math.min(this.options.batchSize, 5000); | ||
} | ||
Object.assign(this.options, query._optionsForExec()); | ||
if (model.collection._shouldBufferCommands() && model.collection.buffer) { | ||
@@ -92,0 +90,0 @@ model.collection.queue.push([ |
@@ -32,3 +32,2 @@ 'use strict'; | ||
'$log10', | ||
'$round', | ||
'$sqrt', | ||
@@ -122,2 +121,9 @@ '$sin', | ||
} | ||
if (val.$round) { | ||
const $round = val.$round; | ||
if (!Array.isArray($round) || $round.length < 1 || $round.length > 2) { | ||
throw new CastError('Array', $round, '$round'); | ||
} | ||
val.$round = $round.map(v => castNumberOperator(v, schema, strictQuery)); | ||
} | ||
@@ -124,0 +130,0 @@ _omitUndefined(val); |
@@ -697,3 +697,5 @@ 'use strict'; | ||
options.applyPluginsToDiscriminators = _mongoose.options && _mongoose.options.applyPluginsToDiscriminators || false; | ||
options.applyPluginsToChildSchemas = typeof (_mongoose.options && _mongoose.options.applyPluginsToDiscriminators) === 'boolean' ? _mongoose.options.applyPluginsToDiscriminators : true; | ||
options.applyPluginsToChildSchemas = typeof (_mongoose.options && _mongoose.options.applyPluginsToChildSchemas) === 'boolean' ? | ||
_mongoose.options.applyPluginsToChildSchemas : | ||
true; | ||
applyPlugins(schema, _mongoose.plugins, options, '$globalPluginsApplied'); | ||
@@ -700,0 +702,0 @@ }; |
@@ -202,2 +202,3 @@ 'use strict'; | ||
fields[path] = 0; | ||
exclude = true; | ||
} else if (type && type.selected && exclude === false) { | ||
@@ -204,0 +205,0 @@ // Make a note of minus paths that are overwriting paths that are |
{ | ||
"name": "mongoose", | ||
"description": "Mongoose MongoDB ODM", | ||
"version": "7.5.3", | ||
"version": "7.5.4", | ||
"author": "Guillermo Rauch <guillermo@learnboost.com>", | ||
@@ -31,5 +31,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "7.22.11", | ||
"@babel/preset-env": "7.22.14", | ||
"@typescript-eslint/eslint-plugin": "5.61.0", | ||
"@babel/core": "7.23.0", | ||
"@babel/preset-env": "7.22.20", | ||
"@typescript-eslint/eslint-plugin": "5.62.0", | ||
"@typescript-eslint/parser": "5.62.0", | ||
@@ -50,3 +50,3 @@ "acquit": "1.3.0", | ||
"dox": "1.0.0", | ||
"eslint": "8.48.0", | ||
"eslint": "8.50.0", | ||
"eslint-plugin-markdown": "^3.0.0", | ||
@@ -59,3 +59,3 @@ "eslint-plugin-mocha-no-only": "1.1.1", | ||
"lodash.isequalwith": "4.4.0", | ||
"markdownlint-cli2": "^0.9.2", | ||
"markdownlint-cli2": "^0.10.0", | ||
"marked": "4.3.0", | ||
@@ -70,7 +70,7 @@ "mkdirp": "^3.0.1", | ||
"q": "1.5.1", | ||
"sinon": "15.2.0", | ||
"sinon": "16.0.0", | ||
"stream-browserify": "3.0.0", | ||
"tsd": "0.29.0", | ||
"typescript": "5.2.2", | ||
"uuid": "9.0.0", | ||
"uuid": "9.0.1", | ||
"webpack": "5.88.2" | ||
@@ -77,0 +77,0 @@ }, |
@@ -135,2 +135,3 @@ 'use strict'; | ||
await Content.deleteMany({ version }); | ||
let count = 0; | ||
for (const content of contents) { | ||
@@ -147,2 +148,3 @@ if (version === '7.x') { | ||
} | ||
console.log(`${++count} / ${contents.length}`); | ||
await content.save(); | ||
@@ -149,0 +151,0 @@ } |
@@ -404,2 +404,6 @@ declare module 'mongoose' { | ||
insertMany<DocContents = TRawDocType>( | ||
docs: Array<DocContents | TRawDocType>, | ||
options: InsertManyOptions | ||
): Promise<Array<MergeType<THydratedDocumentType, Omit<DocContents, '_id'>>>>; | ||
insertMany<DocContents = TRawDocType>( | ||
doc: DocContents | ||
@@ -406,0 +410,0 @@ ): Promise< |
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
2663059
50073