Automattic/mongoose
54.1
Weak · 25 September 2026
52.2k
lines of production code
JavaScript
primary language
4
measurements over time
What this system is
This system is Mongoose, a MongoDB object modeling tool for Node.js that provides schema validation, type casting, and query building capabilities. It manages document lifecycle operations including creation, updates, and deletion, while supporting complex data structures like nested subdocuments, arrays, and discriminators. The library also handles advanced features such as data population, aggregation pipelines, and field-level encryption, ensuring data integrity through strict type checking and middleware hooks.
How it got here
2010–2017 — Modernization and security hardening
12 changes.
This period focused on modernizing the codebase by migrating to the MongoDB Node.js driver v5, refactoring schema types and error handling into ES6 classes, and introducing native support for BigInt and UUID. Significant effort was also dedicated to security hardening through the addition of query sanitization options and improved validation logic for untrusted inputs.
2018–2019 — helper module refactoring and type safety
13 changes.
This period focused on restructuring internal logic into modular helper functions across schema, casting, projection, and population systems to improve maintainability and performance. It introduced stricter type casting rules, structured option classes, and enhanced cursor iteration capabilities, while adding utilities for applying defaults and timestamps to plain objects.
2020–2022 — Internal refactoring and tooling improvements
13 changes.
This period focused on refactoring core internal modules, including index management, timestamp handling, array implementations, and aggregation pipelines, to improve accuracy, performance, and maintainability. Significant effort was also directed toward modernizing the development ecosystem by restructuring TypeScript definitions, migrating type tests to TSTyche, and adding comprehensive performance benchmarks and documentation scripts.
2023–2026 — Cursor refactoring and type safety
6 changes.
This period focused on refactoring the cursor subsystem to improve error handling, add tracing capabilities, and remove legacy callback patterns. It also enhanced document array functionality with virtuals support and stricter property checks, while expanding test coverage for TypeScript type inference and field-level encryption.
Features
Added TypeScript Mongoose benchmark
A new TypeScript benchmark has been added to the benchmarks/typescript/simple directory. It uses Mongoose to define a User schema and model, providing a baseline for performance testing TypeScript applications with MongoDB ODMs. The setup includes a basic tsconfig.json and an .npmrc file to disable package-lock generation.
benchmarks/typescript/simple · high confidence
Enhanced \`eachAsync\` cursor iteration with batching, parallelism, and error handling options
The \eachAsync\ helper for Mongoose cursors has been rewritten to support advanced iteration patterns. Users can now process documents in batches using the \batchSize\ option, run multiple document handlers in parallel via the \parallel\ option, and handle errors gracefully without stopping the entire stream using \continueOnError\. Additionally, the function now supports cancellation via an \AbortSignal\, allowing long-running cursor operations to be stopped early. These changes provide more control and performance flexibility when iterating over large result sets.
lib/helpers/cursor · high confidence
New BSON type exports and subdocument type refactoring
Mongoose now exports \mongoose.Types.Double\, \mongoose.Types.UUID\, and \mongoose.Types.Decimal128\ as direct wrappers around the MongoDB driver's BSON types, enabling native support for these data formats. The \lib/types\ module has been restructured to introduce \ArraySubdocument\ and \Subdocument\ classes, replacing the previous \EmbeddedDocument\ pattern to provide a clearer distinction between array elements and single nested subdocuments. Additionally, \ObjectId\ now includes a \valueOf()\ method to allow standard equality comparisons, and \MongooseBuffer\ has been updated to use the driver's \Binary\ and \UUID\ types directly.
lib/types · high confidence
New documentation and build scripts for the website
The repository now includes a suite of new scripts in the \scripts/\ directory to manage documentation generation and local development. \website.js\ and \static.js\ handle the rendering of documentation pages using Pug and Marked, serving them locally via Express on port 8089 with file watching support. \generateSearch.js\ creates searchable content for the documentation site, while \generateLLMsTXT.js\ produces an LLM-friendly index file. Additional scripts include \loadSponsorData.js\ for fetching sponsor information, \update-mongodb-links.js\ for maintaining dependency links, \tsc-diagnostics-check.js\ for TypeScript benchmarking, and \setup-encryption-tests.js\ for configuring encryption test environments.
scripts · high confidence
New helpers to apply defaults, timestamps, and virtuals to plain objects
Added \applyDefaults\, \applyTimestamps\, and \applyVirtuals\ helper functions in \lib/helpers/document\ that allow applying schema defaults, timestamps, and virtuals to plain JavaScript objects (POJOs) rather than requiring hydrated Mongoose documents. This enables users to generate fully populated plain objects with computed fields and timestamps without the overhead of document instantiation.
lib/helpers/document · high confidence
New model helper utilities for defaults, hooks, and bulk operations
This change introduces a suite of new helper functions in the \lib/helpers/model\ directory to support model-level operations. \applyDefaultsToPOJO\ allows applying schema defaults to plain JavaScript objects, while \applyHooks\, \applyMethods\, \applyStaticHooks\, and \applyStatics\ handle the registration and wrapping of middleware, custom methods, and statics on models. Additionally, \castBulkWrite\ and \decorateBulkWriteResult\ provide the casting, validation, and result decoration logic for \bulkWrite\ operations, and \discriminator\ manages the merging and validation of discriminator schemas.
lib/helpers/model · high confidence
New path helper utilities for parent paths and dotted path setting
Added two new helper modules in lib/helpers/path: parentPaths.js, which generates an array of all parent paths for a given dotted string (e.g., 'a.b.c' becomes \['a', 'a.b', 'a.b.c'\]), and setDottedPath.js, which safely sets a value at a nested dotted path in an object while skipping special properties to prevent prototype pollution and creating intermediate objects as needed.
lib/helpers/path · high confidence
New query helper utilities and sanitization logic
This change introduces a suite of new helper functions in the query module to improve query safety, casting, and configuration handling. It adds \sanitizeFilter\ and \sanitizeProjection\ to automatically sanitize untrusted query inputs, preventing potential injection issues by restricting dangerous operators like \$where\ and \$expr\ in filters and normalizing string-based projections. The update also includes \cast$expr\ for properly casting aggregation expressions, \handleImmutable\ to enforce schema immutability constraints during updates, and utility functions like \applyGlobalMaxTimeMS\ and \applyGlobalDiskUse\ to propagate global connection options to queries. Additionally, \selectPopulatedFields\ ensures that \refPath\ fields are automatically included in projections when populating, and \trusted\ provides a mechanism to mark objects as safe from sanitization.
lib/helpers/query · high confidence
New tools for launching MongoDB test environments
Added three new scripts in the tools directory to simplify setting up MongoDB instances for testing: \auth.js\ launches a standalone MongoDB server with a pre-configured user, \repl.js\ starts a local MongoDB replica set using \mongodb-memory-server\, and \sharded.js\ provisions a sharded cluster topology with shards, config servers, and mongos proxies.
tools · high confidence
New utility to combine path-specific error messages
Added a new helper function, combinePathErrors, in lib/helpers/error/combinePathErrors.js. This utility extracts error messages associated with specific paths from an error object and joins them into a single comma-separated string, simplifying the process of aggregating validation or path-based error details for users.
lib/helpers/error · high confidence
Security
Add sanitizeProjection option to opt in to automatically sanitizing untrusted query projections
Users can now opt in to automatically sanitizing untrusted query projections by setting the \sanitizeProjection\ option. This helps prevent potential security issues when handling user-supplied projection data in queries.
lib · high confidence
Architecture
Refactor DocumentArray methods into dedicated module
The implementation of MongooseDocumentArray methods (including \_cast, id, toObject, and toString) has been extracted into a new dedicated file at lib/types/documentArray/methods/index.js. This change improves code organization and readability by separating the logic for handling embedded documents, ID casting, and array serialization from the main array type definition, without altering the public API or user-facing behavior.
lib/types/documentArray/methods · high confidence
Refactored populate logic into modular helper functions
The internal implementation of the \populate()\ helper has been reorganized into a set of dedicated, single-responsibility modules (such as \assignRawDocsToIdStructure\, \createPopulateQueryFilter\, and \getModelsMapForPopulate\). This refactoring improves code maintainability and performance by separating concerns like query filter creation, model mapping, and value assignment, while preserving the existing populate behavior and options for users.
lib/helpers/populate · high confidence
Schema helper utilities refactored into dedicated modules
The internal schema processing logic has been reorganized into a set of dedicated helper modules within \lib/helpers/schema\. This change extracts specific responsibilities—such as applying built-in and global plugins (\applyBuiltinPlugins.js\, \applyPlugins.js\), managing \\_id\ and timestamp options (\handleIdOption.js\, \handleTimestampOption.js\), and gathering index definitions (\getIndexes.js\)—into their own files. It also introduces new utilities for path resolution (\getPath.js\), strict mode handling (\getSubdocumentStrictValue.js\), and schema merging (\merge.js\). For users, this represents a structural cleanup that improves code maintainability and modularity without altering the public API or schema behavior.
lib/helpers/schema · high confidence
TypeScript definitions restructured into modular files
The TypeScript declaration files in the \types\ directory have been reorganized from a single monolithic file into multiple modular files (e.g., \aggregate.d.ts\, \augmentations.d.ts\, \callback.d.ts\, \collection.d.ts\). This change improves maintainability and potentially TypeScript compilation performance by splitting the type definitions into logical components while preserving the exported API surface.
types · high confidence
Behavioural changes
Cursor implementation refactored with new tracing, error handling, and API updates
The cursor subsystem in lib/cursor has been significantly updated. AggregationCursor and QueryCursor now support a 'transform' option to map documents, and QueryCursor exposes a new getDriverCursor() method to access the underlying MongoDB driver cursor. Error handling has been improved: AggregationCursor.next() now throws if pre-aggregate middleware fails, and ChangeStream methods throw errors if the stream has already errored. The ChangeStream constructor now returns a Promise\<void\> for close(), and the 'ready' event is emitted on the next tick to ensure proper initialization. Callbacks have been removed from eachAsync methods in both AggregationCursor and QueryCursor. Additionally, a new 'mongoose:cursor:next' TracingChannel has been added for monitoring cursor iteration, and performance optimizations include clearing the stack during populate with batchSize to prevent stack overflows.
lib/cursor · high confidence
Document arrays now support virtuals and safer property checks
Document arrays now allow defining virtuals on the array itself, not just on individual elements, enabling new data transformation capabilities at the collection level. The implementation has been refactored to use \Object.hasOwn\ for safer and more readable property checks, replacing previous patterns that relied on \hasOwnProperty\. Additionally, the constructor logic ensures the parent document and schema are correctly set even when the array is instantiated with a schema from a different Mongoose instance, fixing potential cross-instance association issues.
lib/types/documentArray · high confidence
Immutable fields now throw errors in strict mode
The library now enforces immutability for schema fields by throwing a StrictModeError when an attempt is made to modify an immutable path on an existing document, provided strict mode is set to throw. This behavior applies to both top-level and single nested subdocuments, ensuring that immutable fields cannot be accidentally overwritten during updates, while still allowing initial creation and explicit overwrites via the \overwriteImmutable\ option.
lib/helpers/schematype · high confidence
Introduces structured option classes for schema types and operations
Mongoose now defines explicit classes for schema type options (such as SchemaStringOptions, SchemaNumberOptions, SchemaDateOptions, SchemaArrayOptions, SchemaMapOptions, SchemaUnionOptions, SchemaSubdocumentOptions, and SchemaDocumentArrayOptions) as well as operation options (PopulateOptions, SaveOptions, VirtualOptions). These classes formally document and expose specific properties for each type—for example, allowing inline discriminators on subdocuments and document arrays, supporting union types, enabling \allowNull\ to disallow null on non-required paths, and providing default populate options on scalar types—while also introducing validation logic like the mutual exclusivity of \limit\ and \perDocumentLimit\ in populate operations.
lib/options · high confidence
Migrate MongoDB driver integration to node-mongodb-native v5
The MongoDB driver layer has been rewritten to support the node-mongodb-native v5 driver. This update introduces a new \BulkWriteResult\ wrapper to ensure Mongoose returns the correct driver instance, implements \Connection.prototype.removeDb()\ for explicitly closing databases opened via \useDb()\, and adds \Connection.prototype.aggregate()\ for executing db-level aggregations. The connection logic now tracks the last heartbeat timestamp to prevent stale connection states, and collection operations are wrapped to respect per-connection debug settings and buffer timeouts.
lib/drivers/node-mongodb-native · high confidence
Mongoose error classes are refactored into ES6 classes with improved error messages and serialization
The error handling system in \lib/error\ has been refactored to use modern ES6 classes extending a base \MongooseError\. This change introduces several behavioral improvements: \ValidationError\ and \SetOptionError\ now include \toJSON\ methods to ensure \name\ and \message\ appear correctly when serialized; \CastError\ supports custom message formatting via functions and includes \valueType\ and \kind\ properties; \DocumentNotFoundError\ now exposes \numAffected\ and \result\ details; and \MongooseServerSelectionError\ provides more helpful messages for Atlas IP whitelisting and SSL issues. New error types like \MongooseBulkSaveIncompleteError\, \MongooseBulkWriteError\, \EachAsyncMultiError\, and \StrictPopulateError\ have been added to handle specific bulk operation and validation scenarios.
lib/error · high confidence
Refactored MongooseArray implementation with performance and safety improvements
The MongooseArray implementation has been refactored to improve performance and safety. The core array logic is now centralized in a new \lib/types/array/index.js\ file, which uses a Proxy to handle property access and mutations more efficiently, including optimized handling for small arrays and the use of \Object.hasOwn\ for safer property checks. Additionally, a new \lib/types/array/isMongooseArray.js\ helper was added to reliably identify Mongoose array instances. These changes aim to reduce overhead in array operations and prevent unintended side effects during array manipulation.
lib/types/array · high confidence
Refactored array methods into a dedicated module with atomic operation improvements
The array methods previously embedded in the main array type file have been extracted into a new \lib/types/array/methods/index.js\ module. This change introduces a public \getAtomics()\ method, allowing custom container types to access pending atomic operations, and adds a \clearAtomics()\ method to reset these operations after a save. The \$shift()\ method now correctly uses the MongoDB \$pop\ operator instead of overwriting the array, and internal performance optimizations were applied to array proxy operations and setter calls.
lib/types/array/methods · high confidence
Refactored index comparison and discriminator logic for more accurate sync behavior
The index management helpers have been refactored to improve the accuracy of \syncIndexes()\ and \diffIndexes()\. New utility functions now handle specific index types, such as \isTextIndex\ and \isTimeseriesIndex\, ensuring that text indexes are not unnecessarily dropped and that default timeseries collection indexes are preserved. Discriminator index handling has been updated to automatically apply \partialFilterExpression\ constraints, ensuring indexes only apply to the correct discriminator model. Additionally, index equality checks now correctly account for schema-level collations and handle cases where index key order differs, preventing false positives in index comparison.
lib/helpers/indexes · high confidence
Refactored internal helpers and updated BSON handling
The internal helper library has been reorganized and modernized to improve performance and compatibility with MongoDB driver 5. The \lib/helpers\ directory now contains a suite of standalone utility modules (such as \clone.js\, \common.js\, \parallelLimit.js\, and \pathTrie.js\) that replace previous inline implementations. A key behavioral change is the removal of the direct \bson\ dependency in favor of \mongodb/lib/bson\, which updates how BSON types like \ObjectId\, \Decimal128\, and \Binary\ are handled internally. Additionally, the middleware system now uses a new \buildMiddlewareFilter.js\ to manage built-in vs. user middleware, and the \clone\ logic has been enhanced to support new options like \flattenUUIDs\ and \flattenObjectIds\ for controlling serialization output.
lib/helpers · high confidence
Refactored projection logic into modular helper functions
The projection handling logic in \lib/helpers/projection\ has been restructured into a set of dedicated, reusable modules (such as \applyProjection\, \isExclusive\, \isInclusive\, and \parseProjection\). This change replaces the previous monolithic or scattered implementation with a cleaner architecture that explicitly distinguishes between inclusive and exclusive projection modes, correctly handles nested paths, and supports minus-path syntax (e.g., \-field\) for field deselection. Users benefit from more reliable projection application, particularly when dealing with complex nested documents or mixed inclusion/exclusion scenarios, as the new helpers ensure consistent path resolution and type checking.
lib/helpers/projection · high confidence
Refactored query operator casting into dedicated modules
The query casting logic for operators such as $exists, $type, $text, $near, $within, $geoIntersects, and bitwise operations has been extracted from the main SchemaType into separate, dedicated files within lib/schema/operators. This change improves code organization and ensures that specific casting rules (e.g., boolean casting for $exists, string/boolean casting for $text options, and number casting for geospatial distances) are handled consistently and correctly. Users benefit from more robust query validation and fewer edge-case errors when using these operators with arrays or embedded documents.
lib/schema/operators · high confidence
Refactored timestamp handling with immutable createdAt by default
The timestamp logic has been refactored into dedicated helper modules (\setDocumentTimestamps.js\ and \setupTimestamps.js\) to improve maintainability and consistency. By default, the \createdAt\ field is now immutable, preventing accidental updates after initial creation, though this behavior can be overridden via schema options. The update now correctly applies timestamps during \findOneAndReplace\, \replaceOne\, and \insertMany\ operations, and ensures subdocuments receive timestamps even when the parent document does not. Additionally, the system now respects a custom \currentTime\ function if provided in the timestamps configuration.
lib/helpers/timestamps · high confidence
Refactored type casting logic into dedicated modules
The casting logic for all schema types has been reorganized into individual, dedicated modules (bigint, boolean, date, decimal128, double, int32, number, objectid, string, and uuid). This change introduces specific validation rules, such as enforcing MongoDB-compatible bounds for BigInts, rejecting arrays when casting to Int32 or Double, and ensuring UUID schema types return BSON UUIDs. Users benefit from more precise error reporting and stricter type safety during data validation.
lib/cast · high confidence
Schema types refactored into individual modules with new BigInt and UUID support
The schema type definitions (Array, BigInt, Boolean, Buffer, Date, Decimal128, DocumentArray, DocumentArrayElement, Map, Mixed, Number, ObjectId, String, Subdocument, Union, UUID) have been reorganized into separate files under \lib/schema/\. This change introduces native support for \BigInt\ and \UUID\ schema types, allowing users to define these fields directly in their schemas. The \Boolean\ type now enforces stricter casting by default, requiring explicit configuration to accept non-boolean values. Additionally, the \castNonArrays\ option is now available on Array and DocumentArray types to control whether non-array values are automatically wrapped.
lib/schema · high confidence
Sharding and transaction tracking moved to dedicated plugins
The sharding logic and transaction tracking capabilities have been extracted from core model/document handling into dedicated, reusable plugins (\sharding\ and \trackTransaction\) located in \lib/plugins\. The \sharding\ plugin now automatically applies shard keys to \save\, \deleteOne\, and \updateOne\ operations via document hooks, while the \trackTransaction\ plugin manages document state (such as atomics and version keys) within MongoDB transactions. These are exposed alongside the existing \saveSubdocs\ plugin via the new \lib/plugins/index.js\ entry point, allowing users to explicitly register these behaviors on their schemas.
lib/plugins · high confidence
Standardized project configuration and linting setup
The project now uses dedicated configuration files for development workflows: \.gitignore\ and \.npmignore\ have been updated to exclude build artifacts, test files, and local configs from version control and publishing; \.markdownlint-cli2.cjs\ introduces a new markdown linting tool with specific rules for documentation consistency; and \.mocharc.yml\ centralizes Mocha test runner settings. These changes improve maintainability and ensure consistent formatting across the codebase and documentation.
(repo-wide) · high confidence
Fixes
Fixes for discriminator handling and $function operator serialization in aggregation pipelines
This update improves the reliability of aggregation queries involving discriminators and JavaScript functions. When using \Model.watch()\ or standard aggregation, the system now correctly respects discriminators by automatically injecting the necessary filter key into the first pipeline stage (such as \$match\, \$geoNear\, or \$search\) if it is not already present or correctly set, ensuring queries return the expected documents. Additionally, the \$function\ operator now automatically converts JavaScript function bodies to strings, preventing errors when passing functions directly into aggregation stages like \$group\ or \$bucket\. These changes ensure that complex aggregation pipelines with discriminators and custom functions execute without manual intervention or serialization errors.
lib/helpers/aggregate · high confidence
Fixes for embedded discriminator handling and schema merging
This update resolves several issues with embedded discriminators, including ensuring they are applied recursively to nested subdocuments, preventing duplication of indexes and call queues when using shared nested schemas, and allowing numbers and ObjectIds as discriminator values. It also corrects the merging of discriminator schemas to prevent parent schema path duplication, ensures base schema paths are processed before discriminator paths for setters and validators, and fixes the handling of default values for discriminator keys. Additionally, it improves the robustness of discriminator lookup by using a consolidated constructor function and proper BSON type checking.
lib/helpers/discriminator · high confidence
Improved topology detection and error handling for MongoDB Atlas and SSL connections
Added new helper functions to accurately detect MongoDB Atlas connections, identify SSL/TLS errors, and check if all servers are in an unknown state. These changes improve the robustness of connection diagnostics by properly handling topology descriptions with null prototypes and providing clearer error messages for common issues like IP whitelisting and SSL misconfigurations.
lib/helpers/topology · high confidence
Refactored update helpers for timestamps, array filters, and version keys
The update logic in \lib/helpers/update\ has been reorganized into dedicated helper modules to improve reliability and maintainability. Timestamps are now handled by \applyTimestampsToChildren.js\ and \applyTimestampsToUpdate.js\, ensuring \createdAt\ and \updatedAt\ are correctly applied to subdocuments, arrays, and aggregation pipelines, while respecting \timestamps: false\ and \overwriteImmutable\ options. Array filter casting is now managed by \castArrayFilters.js\, which properly handles \$and\/\$or\ conditions, embedded discriminators, and the \strictQuery\ setting. Additionally, \moveImmutableProperties.js\ ensures immutable properties are moved to \$setOnInsert\ during upserts, \decorateUpdateWithVersionKey.js\ handles version key injection, and \removeUnusedArrayFilters.js\ prevents MongoDB errors by stripping unused filters.
lib/helpers/update · high confidence
Test coverage
Added TypeScript type-inference benchmarks for Mongoose schemas; Added and updated test coverage for various Mongoose features and bug fixes; Added integration tests for field-level encryption; Added new performance benchmarks for document creation, queries, and bulk operations; Added tests for exactOptionalPropertyTypes compatibility; Added unit tests for internal helper functions; Migrate TypeScript type tests to TSTyche.
Dependencies
Upgrade mquery to 4.0.0
The mquery dependency has been upgraded to version 4.0.0. This update brings the underlying query builder to a newer major version, which may include internal improvements or breaking changes to the query interface.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 43 → 54 (+10.9)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 53 → 46 (-7.1)
- Architecture 61 (new)
- Maturity 58 → 57 (-1.1)
- Readiness 30 → 79 (+48.8)
- Security 63 → 83 (+20.4)
- Accessibility 59 (new)
Resolved (150)
- $__buildDoc (cognitive 30) (lib/document.js)
- $__buildDoc (cyclomatic 16) (lib/document.js)
- $__delta (cyclomatic 43) (lib/document.js)
- $__init (cognitive 23) (lib/document.js)
- $__set (cyclomatic 34) (lib/document.js)
- $__shouldModify (cyclomatic 18) (lib/document.js)
- $__validateSync (cyclomatic 31) (lib/document.js)
- $set (cognitive 269) (lib/document.js)
- $set (cyclomatic 165) (lib/document.js)
- (anonymous) (cognitive 16) (lib/query.js)
- (anonymous) (cognitive 19) (lib/model.js)
- (anonymous) (cognitive 21) (lib/schema/number.js)
- (anonymous) (cyclomatic 16) (lib/schema/number.js)
- (anonymous) (cyclomatic 20) (lib/query.js)
- Boundary-crossing change coupling: api-bold-current-nav.js ↔ website.js (docs/js/api-bold-current-nav.js)
- Boundary-crossing change coupling: applyBuiltinPlugins.js ↔ index.js (lib/helpers/schema/applyBuiltinPlugins.js)
- Boundary-crossing change coupling: mobile-navbar-toggle.js ↔ website.js (docs/js/mobile-navbar-toggle.js)
- Boundary-crossing change coupling: schemaUnionOptions.js ↔ index.js (lib/options/schemaUnionOptions.js)
- Boundary-crossing change coupling: schemaUnionOptions.js ↔ union.js (lib/options/schemaUnionOptions.js)
- Boundary-crossing change coupling: tutorials.js ↔ website.js (docs/source/tutorials.js)
- …and 130 more
New (518)
- $getAllSubdocs::getSubdocs (cognitive 24) (lib/document.js)
- $set (cognitive 277) (lib/document.js)
- (anonymous) (cognitive 22) (lib/schema/number.js)
- (anonymous) (cyclomatic 17) (lib/schema/number.js)
- CI installs an unverified third-party binary (.github/workflows/documentation.yml)
- Change coupling: getIndexes.js ↔ model.js (lib/helpers/schema/getIndexes.js)
- Coverage not measured — JavaScript/TypeScript suite
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no committed lockfile, so no resolved version to grade)
- Document (cognitive 47) (lib/document.js)
- Documentation: no contributor guidance
- Documentation: no installation or build instructions
- Documentation: no installation or build instructions (README.md)
- Documentation: no licence statement
- Documentation: no project overview
- Documentation: no usage examples
- Documentation: no usage examples (README.md)
- FileTooLong: lib/connection.js (lib/connection.js)
- FileTooLong: lib/schema.js (lib/schema.js)
- FileTooLong: populate/getModelsMapForPopulate.js (lib/helpers/populate/getModelsMapForPopulate.js)
- FunctionTooLong: api.processFile (docs/source/api.js)
- …and 498 more
Changes since last survey
- 185 commits — 131 feature/other, 54 fixes
By area
- (repo) — 68 commits
- (root) — 19 commits
- test/types — 11 commits
- lib/model.js — 9 commits
- lib/schema.js — 8 commits
- lib/helpers — 6 commits
- docs/atlas-search.md — 5 commits
- lib/schema — 5 commits
- lib/cursor — 4 commits
- lib/query.js — 4 commits
- test/docs — 4 commits
- test/schema.test.js — 4 commits
- test/model.test.js — 3 commits
- test/query.cursor.test.js — 3 commits
- docs/atlas-vector-search.md — 2 commits
- docs/queries.md — 2 commits
- docs/version-support.md — 2 commits
- lib/schemaType.js — 2 commits
- lib/types — 2 commits
- test/document.test.js — 2 commits
Notable commits
- fix: Merge pull request #16446 from rajanpanth/fix/int32-double-array-cast
- fix: Merge pull request #16453 from rawmind/fix/broken-hydration
- fix: Merge pull request #16456 from luantaraschi/fix/tojsonschema-enum-null
- fix: Merge pull request #16457 from luantaraschi/fix/omit-map-subpath
- fix: Merge pull request #16458 from rajanpanth/docs/fix-driver-collection-link
- fix: Merge pull request #16461 from luantaraschi/fix/remove-nested-map-path
- fix: Merge pull request #16463 from luantaraschi/fix/clone-array-of-document-arrays
- fix: Merge pull request #16473 from luantaraschi/fix/clone-map-value-schematype
- fix: Merge pull request #16478 from vjymisal0/fix/duplicate-index-warning-message
- fix: Merge pull request #16495 from rajanpanth/fix/is-path-selected-inclusive-dotted
- fix: Merge pull request #16496 from rajanpanth/fix/cast-expr-nested-args
- fix: Merge pull request #16502 from dylanpulver/fix-castobject-model-placeholder
- fix: Merge pull request #16507 from giaBaoJS/fix-documentarray-addtoset-reindex
- fix: Merge pull request #16514 from Shubham-Padkonde/fix/clone-circular-arrays
- fix: Merge pull request #16517 from joshuablac/fix-async-await-api-link
- fix: Merge pull request #16518 from giaBaoJS/fix-map-path-setters
- fix: Merge pull request #16521 from luantaraschi/fix/schema-remove-subpaths
- fix: Merge pull request #16526 from fadiroot/fix/bulkwrite-updatemany-clone
- fix: Potential fix for pull request finding
- fix: fix lint
- …and 165 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Automattic/mongoose was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 25 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 940de5d2c62dc29104b664a0e15be8d4aae38e91 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-dd72cc24c749.