Typegoose - Define Mongoose models using TypeScript classes.
Typegoose - Define Mongoose models using TypeScript classes.
(These badges are from typegoose:master)
Define Mongoose models using TypeScript classes
Migration Guides:
(Date format: dd-mm-yyyy)
25-11-2023)27-03-2023)12-12-2022)22-09-2021)28-07-2021)01-04-2020)30-09-2019)…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:
…npm install
npm run testThis Project should comply with Semver. It uses the Major.Minor.Fix standard (or in NPM terms, Major.Minor.Patch).
To ask questions or just talk with us, join our Discord Server.
+1 or similar comments to issues. Use the reactions instead.No open issues yet, or sync has not completed.