# Automattic/mongoose

MongoDB object modeling designed to work in an asynchronous environment.

Repository: https://github.com/Automattic/mongoose
Canonical: https://ross.abutalabs.com/products/mongoose
Homepage: https://mongoosejs.com
Language: JavaScript
License: MIT
License Family: permissive
Topics: mongo, mongodb, nodejs, odm, orm
Last push: 2026-08-25T16:58:13+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 5993, "days_push": 8, "days_rel": 8, "gap_med": 4, "n_releases_24m": 126}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 27474, forks 4038 (observed 2026-08-28T04:11:47.736155+00:00)

## What it is
Mongoose is a MongoDB object modeling (ODM) library for Node.js and Deno that provides schema-based data modeling with type casting, validation, query building, and middleware hooks. It compiles schemas into models used to construct and query documents in an asynchronous environment.

## Use cases
- define schemas and validate data for a MongoDB collection
- model application data with types, defaults, and virtuals in Node.js
- build queries and add business logic hooks for MongoDB documents
- connect a Node.js or Deno backend to MongoDB
- manage relationships and subdocuments in MongoDB
- add indexes and query helpers to MongoDB models

## When to choose
- you use MongoDB with Node.js and want schema validation and casting out of the box
- you want middleware hooks, virtuals, and query helpers for your data layer
- you prefer a structured, model-driven approach over raw MongoDB drivers
- you need a mature, widely supported ODM with a large plugin ecosystem

## When to avoid
- you use a relational database like PostgreSQL or MySQL
- you want schemaless access and prefer the native MongoDB driver directly
- you need an ORM with joins and SQL-style relations
- your runtime does not support Node.js or Deno

## Facets
- artifact type: library
- maturity: stable
- function: orm, database-driver, database, serialization, middleware
- domain: databases, backend, web-development, developer-tools
- platform: bun
- tags: mongodb, odm, schema-validation, data-modeling, async, nodejs, deno, javascript

## Member repositories
- Automattic/mongoose (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:47.736155+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:54:32.184571+00:00, confidence not recorded.
  - readme: https://github.com/Automattic/mongoose (fetched 2026-08-28T04:11:47.736155+00:00, sha 8802b5fc06d7)
  - homepage: https://mongoosejs.com (fetched 2026-08-29T07:51:56.441236+00:00, sha b014319f1b8c)
  - site_page: https://mongoosejs.com/docs/guide.html (fetched 2026-08-29T07:51:56.450570+00:00, sha bd7a50226929)
  - site_page: https://mongoosejs.com/docs/index.html (fetched 2026-08-29T07:51:56.454057+00:00, sha 34f9139a8a20)
- Data as of 2026-08-30T08:39:29.467469+00:00.
