# Mongoose: 7.8 out of 10

A strong pick. 3rd of 10 in [ORMs and query builders](https://elestia.ai/opensource/orms/index.md).

Mongoose is the long-standing schema and model layer (ODM) for MongoDB in Node.js. It is actively maintained by paid staff at Automattic and is still the default pick when your database is MongoDB. Its TypeScript types are looser than Prisma's or Drizzle's, and its share of new installs is growing more slowly than the category's.

**Best for:** Node.js teams on MongoDB that want schemas, validation, middleware, population and full access to MongoDB queries and aggregations.

## Scores

- **Overall: 7.8** (likely 6.7 to 8.5)
  - Claude Opus 5.5 (7.5): If your database is MongoDB, Mongoose is still the strongest and best-maintained choice in this category. Because it is MongoDB-only, it is a strong pick for a named kind of project rather than the category default. Looser TypeScript types and a recent run of query-sanitizing advisories keep it below 8.
  - GPT-6.2 Sol (8.0): Mongoose is a strong choice for a new MongoDB service that benefits from document schemas, hooks, and transactions. Frequent maintenance and integrations with NestJS and Payload CMS support that recommendation. MikroORM is a credible peer when a team wants the same ORM across MongoDB and SQL. TypeScript gaps, repeated security fixes, and slower relative adoption growth keep the recommendation below the category's top tier.
- **Needed by many: 4.4** (likely 3.4 to 5.5)
  - Claude Opus 5.5 (5.0): Every project needs to read and write a database, but Mongoose serves only MongoDB users. MongoDB is the most-used document database among JavaScript developers, yet it is a minority next to Postgres, MySQL and SQLite. That makes Mongoose clearly narrower than SQL-agnostic peers such as Prisma or Drizzle.
  - GPT-6.2 Sol (3.8): Database access is common in JavaScript backends, and Mongoose serves the subset that uses MongoDB and wants an application-level schema. MongoDB was used by 19% of database respondents in the 2026 Stack Overflow survey. The share of JavaScript and TypeScript teams that want an object modeling layer on top of MongoDB is less clear.
- **Helps a lot: 8.2** (likely 7.1 to 9.1)
  - Claude Opus 5.5 (8.0): For MongoDB it is the most complete tool. Independent comparisons find Prisma lacks embedded documents and aggregation pipelines, and Mongoose has both, along with validation, middleware and population. Version 9 removed callbacks and tightened its TypeScript types. Type inference is still weaker than schema-first peers, and one team reports schema and type mismatches that reached production.
  - GPT-6.2 Sol (8.3): Version 9.12.3 offers mature MongoDB modeling, with casting, validation, middleware, population, and transactions. Its current guides give coding agents clear examples for routine queries and writes, while update validation and schema typing still need careful review. Prosopo reported runtime bugs that TypeScript missed, and a benchmark by the Mongoat author found slower bulk inserts and multi-document reads with Mongoose 9.7.4 defaults. Performance varies by workload, and agent-generated code was not tested directly.
- **Holds up over time: 8.4** (likely 7.3 to 9.1)
  - Claude Opus 5.5 (8.5): The project has 2,132 commits, 79 releases and a release one day before the read date. About 11k issues are closed against 166 open. Automattic employs the lead maintainer, and older major lines get backported fixes. Major versions do bring breaking changes, such as dropping callback middleware in v9, but each comes with migration guides.
  - GPT-6.2 Sol (8.2): Mongoose shipped 79 GitHub releases in a year, maintains several major lines, and closed a recent validation bug within five days. Outside contributors supply fixes, and the project has sponsorship and commercial support channels. Recent releases are concentrated around one lead maintainer, and version 9 removed callback-style pre middleware and raised the Node.js minimum.
- **Used widely: 7.8** (likely 6.8 to 8.6)
  - Claude Opus 5.5 (8.0): Its 833k dependent repositories are four times as many as any peer's, and it has 36.5M downloads every four weeks. Downloads grew 2.6x in a year against a 4.1x median, while Drizzle, Kysely and Prisma grew much faster. Mongoose is widely used but losing share of new choices.
  - GPT-6.2 Sol (7.6): Ecosyste.ms found about 834,000 dependent repositories and 13,800 dependent packages, the strongest recorded repository footprint in this peer group. Four-week npm downloads rose from 14.3 million to 36.5 million, or 2.56 times, below the 4.1 catalog median and well behind Prisma, Drizzle, and Kysely. That suggests a loss of relative momentum, while automated installs, existing codebases, and limited social coverage make new-project adoption hard to estimate.
- **Vouched for: 7.1** (likely 6.0 to 8.2)
  - Claude Opus 5.5 (7.0): Mongoose is the standard MongoDB layer in MERN tutorials and production apps. Independent comparisons still recommend it over Prisma for MongoDB. Developer attention is low, with 0 Bluesky posts and one critical HN story. Survey satisfaction for ORMs favours newer SQL tools.
  - GPT-6.2 Sol (7.1): NestJS maintains a dedicated integration, and Payload CMS builds its MongoDB adapter on Mongoose. The Mongoat benchmark found comparable throughput in most tested operations, while Prosopo reported that type gaps prompted it to look for a replacement. Recent Mongoose-specific satisfaction data and broad production comparisons are sparse.
- **Safe: 6.3** (likely 5.2 to 7.3)
  - Claude Opus 5.5 (6.0): The package has 9 advisories in 24 months. They include a critical sanitizeFilter bypass on countDocuments, a high connection-level sanitizeFilter flaw and prototype-pollution bugs. Fixes shipped across the 6.x to 9.x lines. The MIT licence and 7 dependencies help, but the OpenSSF Scorecard is 6.9, with weak token permissions and dependency pinning.
  - GPT-6.2 Sol (6.5): Version 9.12.3 includes fixes for all five November advisories in the bundle, including a critical query-filter flaw, and the project backported fixes across four major lines. The package is MIT-licensed and has seven direct dependencies. The OpenSSF score of 6.9 reflects weak workflow token permissions, dependency pinning, and fuzzing. Recent GitHub releases are concentrated around one maintainer, and npm publishing permissions and provenance remain unverified.

## Good

- It covers MongoDB fully: embedded documents, aggregation pipelines, discriminators, population and middleware hooks.
- Maintenance is very active, with about 2,100 commits and 79 releases in the last year and the latest release one day before the read date.
- It has by far the largest dependent base in the category, with over 830k GitHub repositories, so examples and AI-agent knowledge are plentiful.
- Security fixes are backported to the 6.x, 7.x and 8.x lines, not only the newest major.

## Bad

- It works only with MongoDB, so it does not serve the SQL majority of the category.
- TypeScript types were added on top of a JavaScript codebase, and users report loose checks that let schema mismatches reach production.
- Nine advisories in 24 months include critical and high sanitizeFilter bypasses and prototype-pollution bugs.
- Downloads grew 2.6x in a year, below the 4.1x median, so it is losing share of new projects.

## The numbers

- Downloads, 4 weeks: 36M
- In a year: ×2.6
- GitHub stars: 27k
- Commits, 12 months: 2.1k
- Last npm release: Nov 2026
- Advisories, 24 months: 9
- Licence: MIT
- GitHub: https://github.com/Automattic/mongoose
- npm: https://www.npmjs.com/package/mongoose

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
