Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

typegoose

> 数据库
Open source

Typegoose - Define Mongoose models using TypeScript classes.

2.3K stars0 likes1 views
WebsiteGitHub

About

Typegoose - Define Mongoose models using TypeScript classes.

Typegoose

(These badges are from typegoose:master)
Define Mongoose models using TypeScript classes

Migration

Migration Guides:
(Date format: dd-mm-yyyy)

  • 11 to 12 (released on 25-11-2023)
  • 10 to 11 (released on 27-03-2023)
  • 9 to 10 (released on 12-12-2022)
  • 8 to 9 (released on 22-09-2021)
  • 7 to 8 (released on 28-07-2021)
  • 6 to 7 (released on 01-04-2020)
  • 5 to 6 (released on 30-09-2019)

Basic usage

…

Motivation

A common problem when using Mongoose with TypeScript is that you have to define both the Mongoose model and the TypeScript interface. If the model changes, you also have to keep the TypeScript interface file in sync or the TypeScript interface would not represent the real data structure of the model.

Typegoose aims to solve this problem by defining only a TypeScript interface (class), which needs to be enhanced with special Typegoose decorators (like @prop).

Under the hood it uses the Reflect & reflect-metadata API to retrieve the types of the properties, so redundancy can be significantly reduced.

Instead of writing this:

…

You can just write this:

…

Extra Examples


Requirements & Install

Typegoose's Quick Start Guide

Testing

bash
npm install
npm run test

Versioning

This Project should comply with Semver. It uses the Major.Minor.Fix standard (or in NPM terms, Major.Minor.Patch).

Join Our Discord Server

To ask questions or just talk with us, join our Discord Server.

Documentation

  • Typegoose Documentation
  • Quick start guide

Known Issues

Here are the known-issues

FAQ

Here is the FAQ

Notes

  • Please don't add +1 or similar comments to issues. Use the reactions instead.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptdbjsmodelmodels

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库