#6464th of 354 in Backends, databases and hosting
mongoose
MongoDB object modeling library for Node.js with schemas, validation and middleware
- Stars
- 27.5k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- JavaScript
27,298 on 2 May 202627,452 on 21 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
Mongoose is an ODM for MongoDB built on the official Node.js driver. Schemas define document structure, validators, defaults, getters, setters, indexes, middleware and populate (pseudo-JOINs). It runs on Node.js, with alpha Deno support, and installs through npm, pnpm, Yarn or Bun.
Who it is for: Node.js developers building apps on MongoDB who want schemas and validation
Strengths
- Schema-level validators, defaults, indexes and pre/post middleware for documents and embedded documents
- Buffers commands until connected, so models and queries can be defined before connect completes
- Built on the official MongoDB Node.js driver; raw collection stays reachable via Model.collection
- Plugin system with hundreds of community modules listed on plugins.mongoosejs.io
Weaknesses
- MongoDB only; no support for other databases
- Deno support is labelled alpha
- Using Model.collection directly bypasses hooks and validation
- Version 9.0.0 includes backwards-breaking changes requiring a migration guide
What it needs
- no GPU
- Needs MongoDB, Node.js
What changed
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Known problems
Reported, then fixed by a linked change
- types: TS2344 error in inferschematype.d.ts and inferrawdoctype.d.ts with exactOptionalPropertyTypes: true and skipLibCheck: false ↗ (opens in a new tab)11 reactions · closed 8 May 2026Fixed by types: handle compiling with exactOptionalPropertyTypes ↗ (opens in a new tab)
- Ability to change CastError error message ↗ (opens in a new tab)1 reactions · closed 28 Aug 2026Fixed by fix(document): replace {MODEL} in custom cast error messages from document validation ↗ (opens in a new tab)
- `string` cannot be used for `PopulatedDoc<T, ObjectId>` (regression) ↗ (opens in a new tab)1 reactions · closed 4 Jun 2026Fixed by types: cast primitive types within unions when applying create casting ↗ (opens in a new tab)
- `Model.bulkSave()` type error with custom string `_id` after #15688 changed Document default to ObjectId ↗ (opens in a new tab)1 reactions · closed 24 Feb 2026Fixed by types(model): make bulkSave() correctly take array of THydratedDocumentType ↗ (opens in a new tab)
- TypeScript `this` Context Error When Calling Static Method on Schema Using `timestamps` and `SchemaOptions.virtuals` ↗ (opens in a new tab)0 reactions · closed 30 Jun 2026Fixed by Fix issues related to defining timestamps and virtuals with methods and/or statics in schema options ↗ (opens in a new tab)
Titles are the reporters' own words, taken from the project's GitHub issues and ranked by reactions. We have not tried to reproduce any of them.
Also in Backends, databases and hosting
See all 354| Rank | Project | Score |
|---|---|---|
| #62 | kyselyType-safe SQL query builder for TypeScript with autocompletion | 84 out of 100 |
| #63 | redisIn-memory data structure server used as cache, database and message broker | 83 out of 100 |
| #65 | phoenixframework/phoenixElixir web framework for HTTP, WebSocket channels and server-rendered apps | 83 out of 100 |
| #66 | logtoSelf-hostable OIDC, OAuth 2.1 and SAML auth service with multi-tenancy and RBAC | 83 out of 100 |
| #67 | webiny-jsTypeScript headless CMS and website builder deployed to your AWS account | 83 out of 100 |