# typegoose/typegoose

Typegoose - Define Mongoose models using TypeScript classes.

Repository: https://github.com/typegoose/typegoose
Canonical: https://ross.abutalabs.com/products/typegoose
Homepage: https://typegoose.github.io/typegoose/
Language: TypeScript
License: MIT
License Family: permissive
Topics: mongoose, typescript, mongodb, nodejs, js, ts, odm, db, models, model
Last push: 2026-08-12T10:53:50+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 91, longevity 100
- inputs: {"age_days": 2679, "days_push": 21, "days_rel": 61, "gap_med": 18.0, "n_releases_24m": 29}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2311, forks 135 (observed 2026-08-28T04:06:36.056334+00:00)

## What it is
Typegoose is a TypeScript library that lets you define Mongoose models using TypeScript classes with decorators, eliminating the need to maintain separate schema and interface definitions. It generates typed Mongoose models from class definitions using the reflect-metadata API.

## Use cases
- define mongoose models with typescript classes
- avoid duplicating mongoose schemas and typescript interfaces
- get type-safe mongodb models in nodejs
- generate mongoose schemas from decorators
- keep typescript types in sync with database models
- use odm with mongodb in a typescript backend

## When to choose
- you use Mongoose with TypeScript and want type-safe models from a single class definition
- you want to reduce boilerplate between schemas and interfaces
- you need compatibility with most Mongoose options while keeping types

## When to avoid
- you use a database other than MongoDB
- your project is plain JavaScript without TypeScript
- you prefer writing Mongoose schemas directly without decorators

## Facets
- artifact type: library
- maturity: active
- function: orm, database-driver, type-system
- domain: databases, web-development, backend, developer-tools
- platform: -
- tags: mongoose, mongodb, odm, decorators, data-modeling, nodejs, typescript, javascript

## Member repositories
- typegoose/typegoose (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:36.056334+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-30T02:39:32.971049+00:00, confidence not recorded.
  - readme: https://github.com/typegoose/typegoose (fetched 2026-08-28T04:06:36.056334+00:00, sha 9855ff4e136f)
  - homepage: https://typegoose.github.io/typegoose/ (fetched 2026-08-29T10:19:57.750342+00:00, sha f6b93e6d6e53)
- Data as of 2026-08-30T08:39:29.467469+00:00.
