| fix tests | 20 天前 |
| test(encryption): fix flaky encryption test | 7 个月前 |
| fix lint | 17 天前 |
| fix(errors): user defines its own r/o err.toJSON When user code defines it's own Error.prototype.toJSON, which is defined as a read-only property - the fixed line crashes. It happens specificly because of the old-school `Object.create(prototype)` thing. | 6 年前 |
| types(document): respect schema toObject and toJSON options | 1 个月前 |
| fix: get aggregation cursor correctly while buffering Re: #16284 | 3 个月前 |
| fix(bigint): throw error when casting BigInt that's outside of the bounds of what MongoDB can safely store Fix #15200 | 1 年前 |
| fix(cast): replace assert.ok with descriptive Error in castNumber When castNumber receives a non-numeric value (e.g. 'hello', {}), assert.ok(!isNaN(val)) throws a raw AssertionError that surfaces as CastError#reason, exposing an internal implementation detail instead of a human-readable message. Replace with an explicit if/throw that raises a plain Error with a descriptive message. Remove the now-unused require('assert'). | 5 个月前 |
| fix(cast): use current castForQuery() signature for object-shaped geo values The object branch of _cast() still passed the legacy single-object argument, so the value landed in the $conditional slot and threw "Can't use [object Object] with Number" instead of casting. Matches the sibling array branch. Fix #16376 | 1 个月前 |
| test: fix flakey tests, remove test for #9597 because it affects global state and fails intermittently on deno | 3 年前 |
| refactor: remove internal callbacks for buffering Re: #15871 | 8 个月前 |
| chore(test/common): re-try dropDBs in a loop instead of option | 3 年前 |
| bump timeout slightly for test reliability | 3 个月前 |
| get rid of mkdirp rimraf in favor of fs/promises | 4 年前 |
| chore(ci): use min reporter for testing (#15911) * chore(ci): use min reporter for testing * Revert "chore(ci): use min reporter for testing" This reverts commit 5d46ab6536e8f4e34e07f1b200ace0ecb7676319. * chore(ci): use min reporter for testing * chore(ci): add :ci scripts with min reporter for CI workflows Keep spec reporter as default for local development, add separate :ci scripts (test:ci, test-rs:ci, test-encryption:ci, test-coverage:ci) that use min reporter to reduce output in CI logs. * chore(ci): add test-deno:ci with min reporter Add --reporter support to deno_mocha.mjs and create test-deno:ci script to use min reporter in CI for Deno tests as well. * fix(ci): use -- to pass args to deno script * fix(ci): pass --reporter arg to deno tests correctly Script path must come before args in child_args, otherwise Deno interprets them as its own CLI flags instead of script arguments. * refactor(ci): make :ci scripts call base scripts with --reporter min Instead of duplicating the full command in each :ci script, they now call their base script with `-- --reporter min`. This makes maintenance easier as changes to base scripts are automatically inherited. | 8 个月前 |
| chore(ci): use min reporter for testing (#15911) * chore(ci): use min reporter for testing * Revert "chore(ci): use min reporter for testing" This reverts commit 5d46ab6536e8f4e34e07f1b200ace0ecb7676319. * chore(ci): use min reporter for testing * chore(ci): add :ci scripts with min reporter for CI workflows Keep spec reporter as default for local development, add separate :ci scripts (test:ci, test-rs:ci, test-encryption:ci, test-coverage:ci) that use min reporter to reduce output in CI logs. * chore(ci): add test-deno:ci with min reporter Add --reporter support to deno_mocha.mjs and create test-deno:ci script to use min reporter in CI for Deno tests as well. * fix(ci): use -- to pass args to deno script * fix(ci): pass --reporter arg to deno tests correctly Script path must come before args in child_args, otherwise Deno interprets them as its own CLI flags instead of script arguments. * refactor(ci): make :ci scripts call base scripts with --reporter min Instead of duplicating the full command in each :ci script, they now call their base script with `-- --reporter min`. This makes maintenance easier as changes to base scripts are automatically inherited. | 8 个月前 |
| perf(document): cache projection metadata and avoid scanning all projected paths for flat projections `isSelected()` recomputed everything from `$__.selected` on every call: it allocated a fresh `Object.keys()` array, re-derived whether the projection was inclusive or exclusive, and then scanned every projected key looking for a prefix relationship with the requested path. `toObject({ getters: true })` calls `isSelected()` once per schema path, so serializing a projected document cost O(schema paths x projected paths). Two changes: - `$__.selected` is assigned once in the Document constructor and never mutated, so the derived values are computed once per document and cached on `$__`. `isDirectSelected()` reuses the same cache. - When no projected key is nested, no key can start with `path + '.'`, so only the "is an ancestor of `path` projected?" check can match. Every matching ancestor yields the same answer, so walking the path's own ancestors is equivalent to scanning every projected key, and is O(depth of path) instead of O(number of projected paths). Projections containing a nested key still take the original scan. Re: #16373 | 29 天前 |
| BREAKING CHANGE: remove support for callbacks in pre middleware Fix #11531 | 1 年前 |
| fix: await post.populate() in test to prevent dangling promise and fix flaky test on Node 18 | 1 个月前 |
| remove a bunch of other callback methods | 3 年前 |
| add one more test re: #16345 | 1 个月前 |
| Merge branch 'master' into vkarpov15/gh-14394-2 | 1 个月前 |
| perf(document+schema): cache which paths have transforms re: #16405 #16378 | 1 个月前 |
| fix(cast): reject arrays when casting to Int32 or Double Number([5]) is 5 and Number([]) is 0, so a single-element or empty array reached the fallback Number() coercion in castInt32 and castDouble and silently produced a plausible-looking number instead of throwing a CastError -- unlike castNumber(), which already guards against this with an explicit Array.isArray() check, and unlike castBigInt()/castDecimal128(), whose exhaustive allow-lists never match an array in the first place. Multi-element arrays already threw correctly (Number([5,6]) is NaN), so only the single-element/empty cases were affected. | 27 天前 |
| fix tests | 1 年前 |
| BREAKING CHANGE: remove bson as direct dependency, use mongodb/lib/bson instead Fix #15154 | 1 年前 |
| fix(schema): always pass raw string value to error validators, only trim to 30 chars for maxlength validator Fix #16236 Re: #15550 Re: #15571 | 4 个月前 |
| add newline at end of file | 4 年前 |
| fix failing tests | 4 年前 |
| Improve tests (#12401) * test(model.test): convert a test to async/await in hopes it does not fail locally anymore * test(common): remove setting "CURRENT_TEST" unused variable * test: remove usage of "process.env.TRAVIS" and use lowest timeout | 3 年前 |
| feat: add timestamp option to debug | 4 个月前 |
| Update validation tests for insertOne method | 4 个月前 |
| fix(cast): reject arrays when casting to Int32 or Double Number([5]) is 5 and Number([]) is 0, so a single-element or empty array reached the fallback Number() coercion in castInt32 and castDouble and silently produced a plausible-looking number instead of throwing a CastError -- unlike castNumber(), which already guards against this with an explicit Array.isArray() check, and unlike castBigInt()/castDecimal128(), whose exhaustive allow-lists never match an array in the first place. Multi-element arrays already threw correctly (Number([5,6]) is NaN), so only the single-element/empty cases were affected. | 27 天前 |
| chore: rename deno files to ".mjs" To ensure it is loaded and recognized as a module. Makes eslint 9.0 configuration easier. | 1 年前 |
| test: remove "mongo24|6_or_greater" check because since mongoose 5.x, versions below mongodb 3.0.0 are unsupported, so we are always above. | 1 年前 |
| fix tests | 24 天前 |
| test: fix flaky test | 7 个月前 |
| fix(queryHelpers): pass default options to discriminators Re: #16226 | 4 个月前 |
| fix tests | 13 天前 |
| fix(document): throw error if overwriting array selected with $slice Fix #2432 | 3 个月前 |
| feat: add `transactionAsyncLocalStorage` option to opt in to automatically setting `session` on all transactions Fix #13889 | 2 年前 |
| BREAKING CHANGE: use MongoDB node driver 6, drop support for `rawResult` option and `findOneAndRemove()` | 2 年前 |
| BREAKING CHANGE: use MongoDB node driver 6, drop support for `rawResult` option and `findOneAndRemove()` | 2 年前 |
| test+docs: improve tests and examples about allowNull | 3 个月前 |
| fix(hidration): use the doc model for looking up a ref | 17 天前 |
| test: enable / remove skipped tests Enable tests that seem to work. Remove tests for removed functionality. Enable "mocha/no-pending-tests" lint. | 1 年前 |
| fix(model): support timestamps option to `insertMany()` as both boolean and QueryTimestampsConfig | 7 个月前 |
| chore: set `GEN_TYPE_TESTS` to `false` | 6 个月前 |
| Merge branch '8.x' | 8 个月前 |
| test: fix a bunch more test failures | 3 年前 |
| fix: depopulate if `push()` or `addToSet()` with an ObjectId on a populated array Fix #1635 | 1 年前 |
| test(populate): add coverage showing defining `ref` on array of ObjectIds re: #9232 | 17 天前 |
| upgrade to pre-release of mongodb node driver 7 | 10 个月前 |
| test: remove "mongo24|6_or_greater" check because since mongoose 5.x, versions below mongodb 3.0.0 are unsupported, so we are always above. | 1 年前 |
| revert: restore master before middleware skip changes | 2 个月前 |
| test(model): assert exact __v values in bulkSave new document test | 1 个月前 |
| Amending Model.translateAliases to observe non-aliased sub schemas | 4 年前 |
| test(query): cover modifier-named dollar paths re #15642 | 1 个月前 |
| test: add quick test to show that casting still happens even if you skip the validation | 3 个月前 |
| shuffle around error handler re: ChangeStream is closed errors | 1 年前 |
| Merge branch 'master' into 9.0 | 1 年前 |
| Add parenthesis | 4 年前 |
| style: fix lint | 1 年前 |
| remove a bunch of other callback methods | 3 年前 |
| fix(query): apply sanitizeFilter on countDocuments and cursor() | 28 天前 |
| BREAKING CHANGE: remove support for callbacks in pre middleware Fix #11531 | 1 年前 |
| Merge pull request #16409 from BIGSUS24/fix/subdocument-select-false-projection-collision fix(query): avoid path collision when excluding subdocument with select: false child (gh-12798) | 1 个月前 |
| BREAKING CHANGE: stop using mquery for `updateX()`, `deleteX()`, `sort()`, always convert sort args to objects Re: #13617 | 2 年前 |
| BREAKING CHANGE: rename top-level files to camel case | 2 年前 |
| Merge branch 'master' into 7.5 | 3 年前 |
| Add parenthesis | 4 年前 |
| test: remove remaining unnecessary collections Fix #8481 | 6 年前 |
| WIP replace caster with embeddedSchemaType and Constructor re: #15179 | 1 年前 |
| Add parenthesis | 4 年前 |
| BREAKING CHANGE: make SchemaType.prototype.doValidate() an async function for cleaner stack traces | 1 年前 |
| test: clean up a bunch more test failures | 3 年前 |
| fix(schema): only return own properties in schematype lookups | 2 个月前 |
| fix(schema): only return own properties in schematype lookups | 2 个月前 |
| docs(findOneAndUpdate): clarify update handling of undefined | 3 个月前 |
| fix(SchemaType): add missing continue Fix #15380 | 1 年前 |
| feat: run tests on Deno Re: #9056 | 3 年前 |
| fix(schema): keep the map value schematype a single object when cloning A map's value SchemaType is one object registered as paths[p + '.$*'], as paths[p].$__schemaType and inside mapPaths. _clone rebuilt paths entry by entry, which split it into two copies, and then carried the source schema's mapPaths references straight into the copy. schema.path('m.$*') hands back the paths entry, so that is where a getter, setter or validator lands, while MongooseMap reads them off the map's own $__schemaType. On a clone those stopped being the same object, so the configuration was quietly ignored: a setter did not run, a getter did not run, and a validator accepted a value it was written to reject. Point the two back at one object once paths is rebuilt, and build mapPaths from the clone instead of from the schema it came from. | 11 天前 |
| test(schema): add tests for ObjectId regex pattern in toJSONSchema re #16334 | 2 个月前 |
| BREAKING CHANGE: remove bson as direct dependency, use mongodb/lib/bson instead Fix #15154 | 1 年前 |
| test+docs: improve tests and examples about allowNull | 3 个月前 |
| fix formatting | 1 年前 |
| BREAKING CHANGE: remove bson as direct dependency, use mongodb/lib/bson instead Fix #15154 | 1 年前 |
| test(schematype): exempt "DocumentArrayElement" from "set() when given a default option, set its" | 7 个月前 |
| chore: replace many occurrences of "localhost" with "127.0.0.1" | 3 年前 |
| add overwriteMiddlewareArguments to TypeScript types and handle overwriteArguments in pre("deleteOne") and pre("updateOne") document hooks | 9 个月前 |
| style: apply "eol-last" rule | 4 年前 |
| test: improve flakey test from #16461 | 13 天前 |
| refactor: give each operation its own TracingChannel Each operation now has a dedicated channel so subscribers only pay overhead for the operations they care about: - mongoose:query (Query.exec) - mongoose:aggregate (Aggregate.exec) - mongoose:model:save - mongoose:model:insertMany - mongoose:model:bulkWrite - mongoose:cursor:next tracing.js exports createTracedChannel so each module manages its own channel. Tests subscribe by channel name via diagnostics_channel directly. | 3 个月前 |
| test(schema): exercise array query cast in setters mutation regression test | 1 个月前 |
| Add parenthesis | 4 年前 |
| test: remove remaining unnecessary collections Fix #8481 | 6 年前 |
| BREAKING CHANGE: refactor validate() to be async and validate hooks out of kareem wrappers | 1 年前 |
| Merge branch '8.x' | 1 个月前 |
| chore: ensure all node tests do `require('./common')` first so they can work independently Fix #8308 | 6 年前 |
| BREAKING CHANGE: make schema paths declared with `type: { name: String }` create a single nested subdoc, remove `typePojoToMixed` because it is now always false Fix #7181 | 6 年前 |
| fix(documentArray): fix change tracking for documentArrays in nested maps (#15983) * test(map): test document arrays in nested maps * fix(documentArray): strip path from options in subdoc $init re #15350 #15678 #15970 #15682 | 7 个月前 |
| fix(schema): correct error when unsupported query operator with number re: #16062 | 5 个月前 |
| fix(subdocument): don't minimize empty document array elements to null Re: #7322 #15336 Since 8.14.0 (#15336), an all-undefined subdocument inside a document array is minimized to undefined during serialization, which BSON stores as null - reintroducing the problem fixed in 5.4.6 (#7322). Restore the array-element exclusion the minimize logic had in clone() by checking $isDocumentArrayElement in Subdocument.prototype.$toObject(). | 1 个月前 |
| test: try fixing flakey tests by explicitly deleting buffered collection | 3 个月前 |
| Merge pull request #16190 from KhanjarSingh/fix-deepequal-set fix(utils): implement proper deepEqual comparison for Set objects | 5 个月前 |
| fix(pathTrie): handle numeric path lookups: when path segment is a number, assume array and skip Fix #16383 | 30 天前 |
| test: avoid importing VirtualType directly to avoid driver issues re: #12953 | 3 年前 |