{"id":13990833,"url":"https://github.com/szokodiakos/typegoose","last_synced_at":"2025-09-28T22:31:24.315Z","repository":{"id":51645493,"uuid":"85357546","full_name":"szokodiakos/typegoose","owner":"szokodiakos","description":"Typegoose - Define Mongoose models using TypeScript classes.","archived":true,"fork":false,"pushed_at":"2021-05-10T22:53:43.000Z","size":1201,"stargazers_count":1224,"open_issues_count":18,"forks_count":137,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-09-09T11:03:54.749Z","etag":null,"topics":["mongodb","mongoose","odm","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szokodiakos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null}},"created_at":"2017-03-17T21:50:35.000Z","updated_at":"2024-08-20T09:19:57.000Z","dependencies_parsed_at":"2022-08-20T16:50:28.898Z","dependency_job_id":null,"html_url":"https://github.com/szokodiakos/typegoose","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szokodiakos%2Ftypegoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szokodiakos%2Ftypegoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szokodiakos%2Ftypegoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szokodiakos%2Ftypegoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szokodiakos","download_url":"https://codeload.github.com/szokodiakos/typegoose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234569704,"owners_count":18854133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mongodb","mongoose","odm","ts","typescript"],"created_at":"2024-08-09T13:03:21.572Z","updated_at":"2025-09-28T22:31:23.971Z","avatar_url":"https://github.com/szokodiakos.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# This Repository got moved\n\nPlease use [hasezoey's fork](https://github.com/hasezoey/typegoose) to be up-to-date\nPlease dont create new issues \u0026 pull request anymore, thanks\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n# Typegoose\n\n[![Build Status](https://travis-ci.org/szokodiakos/typegoose.svg?branch=master)](https://travis-ci.org/szokodiakos/typegoose)\n[![Coverage Status](https://coveralls.io/repos/github/szokodiakos/typegoose/badge.svg?branch=master#feb282019)](https://coveralls.io/github/szokodiakos/typegoose?branch=master)\n[![npm](https://img.shields.io/npm/dt/typegoose.svg)]()\n\nDefine Mongoose models using TypeScript classes.\n\n## Basic usage\n\n```ts\nimport { prop, Typegoose, ModelType, InstanceType } from 'typegoose';\nimport * as mongoose from 'mongoose';\n\nmongoose.connect('mongodb://localhost:27017/test');\n\nclass User extends Typegoose {\n  @prop()\n  name?: string;\n}\n\nconst UserModel = new User().getModelForClass(User);\n\n// UserModel is a regular Mongoose Model with correct types\n(async () =\u003e {\n  const u = await UserModel.create({ name: 'JohnDoe' });\n  const user = await UserModel.findOne();\n\n  // prints { _id: 59218f686409d670a97e53e0, name: 'JohnDoe', __v: 0 }\n  console.log(user);\n})();\n```\n\n## Motivation\n\nA 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.\n\nTypegoose aims to solve this problem by defining only a TypeScript interface (class) which need to be enhanced with special Typegoose decorators.\n\nUnder the hood it uses the [reflect-metadata](https://github.com/rbuckton/reflect-metadata) API to retrieve the types of the properties, so redundancy can be significantly reduced.\n\nInstead of:\n\n```ts\ninterface Car {\n  model?: string;\n}\n\ninterface Job {\n  title?: string;\n  position?: string;\n}\n\ninterface User {\n  name?: string;\n  age: number;\n  job?: Job;\n  car: Car | string;\n}\n\nmongoose.model('User', {\n  name: String,\n  age: { type: Number, required: true },\n  job: {\n    title: String;\n    position: String;\n  },\n  car: { type: Schema.Types.ObjectId, ref: 'Car' }\n});\n\nmongoose.model('Car', {\n  model: string,\n});\n```\n\nYou can just:\n\n```ts\nclass Job {\n  @prop()\n  title?: string;\n\n  @prop()\n  position?: string;\n}\n\nclass Car extends Typegoose {\n  @prop()\n  model?: string;\n}\n\nclass User extends Typegoose {\n  @prop()\n  name?: string;\n\n  @prop({ required: true })\n  age!: number;\n\n  @prop()\n  job?: Job;\n\n  @prop({ ref: Car })\n  car?: Ref\u003cCar\u003e;\n}\n```\n\nPlease note that sub documents do not have to extend Typegoose. You can still give them default value in `prop` decorator, but you can't create static or instance methods on them.\n\n## Requirements\n\n* TypeScript 3.2+\n* Node 8+\n* mongoose 5+\n* `emitDecoratorMetadata` and `experimentalDecorators` must be enabled in `tsconfig.json`\n* `reflect-metadata` must be installed\n\n## Install\n\n`npm install typegoose -S`\n\nYou also need to install `mongoose` and `reflect-metadata`, in versions \u003c 5.0, these packages were listed as dependencies in `package.json`, starting with version 5.0 these packages are listed as peer dependencies.\n\n`npm install mongoose reflect-metadata -S`\n\n## Testing\n\n`npm test`\n\n## Versioning\n\n`Major.Minor.Fix` (or how npm expresses it `Major.Minor.Patch`)\n\n* `0.0.x` is for minor fixes, like hot-fixes\n* `0.x.0` is for Minor things like adding features, that are non-breaking (or at least should not be breaking anything)\n* `x.0.0` is for Major things like adding features that are breaking or refactoring which is a breaking change\n* `0.0.0-x` is for a Pre-Release, that are not yet ready to be published\n\n## API Documentation\n\n### Typegoose class\n\nThis is the class which your schema defining classes must extend.\n\n#### Methods:\n\n`getModelForClass\u003cT\u003e(t: T, options?: GetModelForClassOptions)`\n\nThis method returns the corresponding Mongoose Model for the class (`T`). If no Mongoose model exists for this class yet, one will be created automatically (by calling the method `setModelForClass`).\n\n\n`setModelForClass\u003cT\u003e(t: T, options?: GetModelForClassOptions)`\n\nThis method assembles the Mongoose Schema from the decorated schema defining class, creates the Mongoose Model and returns it. For typing reasons, the schema defining class must be passed down to it.\n\nHint: If a Mongoose Model already exists for this class, it will be overwritten.\n\n\nThe `GetModelForClassOptions` provides multiple optional configurations:\n * `existingMongoose: mongoose`: An existing Mongoose instance can also be passed down. If given, Typegoose uses this Mongoose instance's `model` methods.\n * `schemaOptions: mongoose.SchemaOptions`: Additional [schema options](http://mongoosejs.com/docs/guide.html#options) can be passed down to the schema-to-be-created.\n * `existingConnection: mongoose.Connection`: An existing Mongoose connection can also be passed down. If given, Typegoose uses this Mongoose instance's `model` methods.\n\n### Property decorators\n\nTypegoose comes with TypeScript decorators, which responsibility is to connect the Mongoose schema behind the TypeScript class.\n\n#### prop(options)\n\nThe `prop` decorator adds the target class property to the Mongoose schema as a property. Typegoose checks the decorated property's type and sets the schema property accordingly. If another Typegoose extending class is given as the type, Typegoose will recognize this property as a sub document.\n\nThe `options` object accepts multiple config properties:\n  - `required`: Just like the [Mongoose required](http://mongoosejs.com/docs/api.html#schematype_SchemaType-required)\n    it accepts a handful of parameters. Please note that it's the developer's responsibility to make sure that\n    if `required` is set to `false` then the class property should be [optional](https://www.typescriptlang.org/docs/handbook/interfaces.html#optional-properties).\n\n    Note: for coding style (and type completion) you should use `!` when it is marked as required\n\n    ```ts\n    // this is now required in the schema\n    @prop({ required: true })\n    firstName!: string;\n\n    // by default, a property is not required\n    @prop()\n    lastName?: string; // using the ? optional property\n    ```\n\n  - `index`: Tells Mongoose whether to define an index for the property.\n\n    ```ts\n    @prop({ index: true })\n    indexedField?: string;\n    ```\n\n  - `unique`: Just like the [Mongoose unique](http://mongoosejs.com/docs/api.html#schematype_SchemaType-unique), tells Mongoose to ensure a unique index is created for this path.\n\n    ```ts\n    // this field is now unique across the collection\n    @prop({ unique: true })\n    uniqueId?: string;\n    ```\n\n  - `enum`: The enum option accepts a string array. The class property which gets this decorator should have an enum-like type which values are from the provided string array. The way how the enum is created is delegated to the developer, Typegoose needs a string array which hold the enum values, and a TypeScript type which tells the possible values of the enum.\n  However, if you use TS 2.4+, you can use string enum as well.\n\n    ```ts\n    enum Gender {\n      MALE = 'male',\n      FEMALE = 'female',\n    }\n\n    @prop({ enum: Gender })\n    gender?: Gender;\n    ```\n\n  - `lowercase`: for strings only; whether to always call .toLowerCase() on the value.\n\n    ```ts\n    @prop({ lowercase: true })\n    nickName?: string;\n    ```\n\n  - `uppercase`: for strings only; whether to always call .toUpperCase() on the value.\n\n    ```ts\n    @prop({ uppercase: true })\n    nickName?: string;\n    ```\n\n  - `trim`: for strings only; whether to always call .trim() on the value.\n\n    ```ts\n    @prop({ trim: true })\n    nickName?: string;\n    ```\n\n  - `default`: The provided value will be the default for that Mongoose property.\n\n    ```ts\n    @prop({ default: 'Nick' })\n    nickName?: string;\n    ```\n    \n  - `_id`: When false, no \\_id is added to the subdocument\n\n    ```ts\n    class Car extends Typegoose {}\n    \n    @prop({ _id: false })\n    car?: Car;\n    ```\n\n  - `ref`: By adding the `ref` option with another Typegoose class as value, a Mongoose reference property will be created. The type of the property on the Typegoose extending class should be `Ref\u003cT\u003e` (see Types section).\n\n    ```ts\n    class Car extends Typegoose {}\n\n    @prop({ ref: Car })\n    car?: Ref\u003cCar\u003e;\n    ```\n\n  - `refPath`: Is the same as `ref`, only that it looks at the path specified, and this path decides which model to use\n\n    ```ts\n    class Car extends Typegoose {}\n    class Shop extends Typegoose {}\n\n    // in another class\n    class Another extends Typegoose {\n      @prop({ required: true, enum: 'Car' | 'Shop' })\n      which!: string;\n\n      @prop({ refPath: 'which' })\n      kind?: Ref\u003cCar | Shop\u003e;\n    }\n    ```\n\n  - `min` / `max` (numeric validators): Same as [Mongoose numberic validators](http://mongoosejs.com/docs/api.html#schema_number_SchemaNumber-max).\n\n    ```ts\n    @prop({ min: 10, max: 21 })\n    age?: number;\n    ```\n\n  - `minlength` / `maxlength` / `match` (string validators): Same as [Mongoose string validators](http://mongoosejs.com/docs/api.html#schema_string_SchemaString-match).\n\n    ```ts\n    @prop({ minlength: 5, maxlength: 10, match: /[0-9a-f]*/ })\n    favouriteHexNumber?: string;\n    ```\n\n\n  - `validate` (custom validators): You can define your own validator function/regex using this. The function has to return a `boolean` or a Promise (async validation).\n\n    ```ts\n    // you have to get your own `isEmail` function, this is a placeholder\n\n    @prop({ validate: (value) =\u003e isEmail(value)})\n    email?: string;\n\n    // or\n\n    @prop({ validate: (value) =\u003e { return new Promise(res =\u003e { res(isEmail(value)) }) })\n    email?: string;\n\n    // or\n\n    @prop({ validate: {\n        validator: val =\u003e isEmail(val),\n        message: `{VALUE} is not a valid email`\n    }})\n    email?: string;\n\n    // or\n\n    @prop({ validate: /\\S+@\\S+\\.\\S+/ })\n    email?: string;\n\n    // you can also use multiple validators in an array.\n\n    @prop({ validate:\n      [\n        {\n            validator: val =\u003e isEmail(val),\n            message: `{VALUE} is not a valid email`\n        },\n        {\n            validator: val =\u003e isBlacklisted(val),\n            message: `{VALUE} is blacklisted`\n        }\n      ]\n    })\n    email?: string;\n    ```\n\n  - `alias` (alias): Same as [Mongoose Alias](https://mongoosejs.com/docs/guide.html#aliases), only difference is the extra property for type completion\n    ```ts\n    class Dummy extends Typegoose {\n      @prop({ alias: \"helloWorld\" })\n      public hello: string; // will be included in the DB\n      public helloWorld: string; // will NOT be included in the DB, just for type completion (gets passed as hello in the DB)\n    }\n    ```\n\nMongoose gives developers the option to create [virtual properties](http://mongoosejs.com/docs/api.html#schema_Schema-virtual). This means that actual database read/write will not occur these are just 'calculated properties'. A virtual property can have a setter and a getter. TypeScript also has a similar feature which Typegoose uses for virtual property definitions (using the `prop` decorator).\n\n```ts\n@prop()\nfirstName?: string;\n\n@prop()\nlastName?: string;\n\n@prop() // this will create a virtual property called 'fullName'\nget fullName() {\n  return `${this.firstName} ${this.lastName}`;\n}\nset fullName(full) {\n  const [firstName, lastName] = full.split(' ');\n  this.firstName = firstName;\n  this.lastName = lastName;\n}\n```\n\nTODO: add documentation for virtual population\n\n#### arrayProp(options)\n\nThe `arrayProp` is a `prop` decorator which makes it possible to create array schema properties.\n\nThe `options` object accepts `required`, `enum` and `default`, just like the `prop` decorator. In addition to these the following properties exactly one should be given:\n\n  - `items`: This will tell Typegoose that this is an array which consists of primitives (if `String`, `Number`, or other primitive type is given) or this is an array which consists of subdocuments (if it's extending the `Typegoose` class).\n\n    ```ts\n    @arrayProp({ items: String })\n    languages?: string[];\n    ```\n\nNote that unfortunately the [reflect-metadata](https://github.com/rbuckton/reflect-metadata) API does not let us determine the type of the array, it only returns `Array` when the type of the property is queried. This is why redundancy is required here.\n\n  - `itemsRef`: In mutual exclusion with `items`, this tells Typegoose that instead of a subdocument array, this is an array with references in it. On the Mongoose side this means that an array of Object IDs will be stored under this property. Just like with `ref` in the `prop` decorator, the type of this property should be `Ref\u003cT\u003e[]`.\n\n    ```ts\n    class Car extends Typegoose {}\n\n    // in another class\n    @arrayProp({ itemsRef: Car })\n    previousCars?: Ref\u003cCar\u003e[];\n    ```\n\n  - `itemsRefPath`(IRP): Is the same as `itemsRef` only that it looks at the specified path of the class which specifies which model to use\n\n    ```ts\n    class Car extends Typegoose {}\n    class Shop extends Typegoose {}\n\n    // in another class\n    class Another extends Typegoose {\n      @prop({ required: true, enum: 'Car' | 'Shop' })\n      which!: string;\n\n      @arrayProp({ itemsRefPath: 'which' })\n      items?: Ref\u003cCar | Shop\u003e[];\n    }\n    ```\n\n#### mapProp(options)\n\nThe `mapProp` is a `prop` decorator which makes it possible to create map schema properties.\n\nThe options object accepts `enum` and `default`, just like `prop`  decorator. In addition to these the following properties are accepted:\n\n  - `of`  : This will tell Typegoose that the Map value consists of primitives (if `String`, `Number`, or other primitive type is given) or this is an array which consists of subdocuments (if it's extending the `Typegoose` class).\n\n    ```ts\n    class Car extends Typegoose {\n      @mapProp({ of: Car })\n      public keys?: Map\u003cstring, Car\u003e;\n    }\n    ```\n\n  - `mapDefault` : This will set the default value for the map.\n\n    ```ts\n    enum ProjectState {\n        WORKING = 'working',\n        BROKEN = 'broken',\n        MAINTAINANCE = 'maintainance',\n    }\n\n    class Car extends Typegoose {\n      @mapProp({ of: String, enum: ProjectState,mapDefault: { 'MainProject' : ProjectState.WORKING }})\n      public projects?: Map\u003cstring, ProjectState\u003e;\n    }\n    ```\n\n### Method decorators\n\nIn Mongoose we can attach two types of methods for our schemas: static (model) methods and instance methods. Both of them are supported by Typegoose.\n\n#### staticMethod\n\nStatic Mongoose methods must be declared with `static` keyword on the Typegoose extending class. This will ensure, that these methods are callable on the Mongoose model (TypeScript won't throw development-time error for unexisting method on model object).\n\nIf we want to use another static method of the model (built-in or created by us) we have to override the `this` in the method using the [type specifying of `this` for functions](https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#specifying-the-type-of-this-for-functions). If we don't do this, TypeScript will throw development-time error on missing methods.\n\n```ts\n@staticMethod\nstatic findByAge(this: ModelType\u003cUser\u003e \u0026 typeof User, age: number) {\n  return this.findOne({ age });\n}\n```\n\nNote that the `\u0026 typeof T` is only mandatory if we want to use the developer defined static methods inside this static method. If not then the `ModelType\u003cT\u003e` is sufficient, which will be explained in the Types section.\n\n#### instanceMethod\n\nInstance methods are on the Mongoose document instances, thus they must be defined as non-static methods. Again if we want to call other instance methods the type of `this` must be redefined to `InstanceType\u003cT\u003e` (see Types).\n\n```ts\n@instanceMethod\nincrementAge(this: InstanceType\u003cUser\u003e) {\n  const age = this.age || 1;\n  this.age = age + 1;\n  return this.save();\n}\n```\n\n### Class decorators\n\nMongoose allows the developer to add pre and post [hooks / middlewares](http://mongoosejs.com/docs/middleware.html) to the schema. With this it is possible to add document transformations and observations before or after validation, save and more.\n\nTypegoose provides this functionality through TypeScript's class decorators.\n\n#### pre\n\nWe can simply attach a `@pre` decorator to the Typegoose class and define the hook function like you normally would in Mongoose.\n(Method supports REGEXP)\n\n```ts\n@pre\u003cCar\u003e('save', function(next) { // or @pre(this: Car, 'save', ...\n  if (this.model === 'Tesla') {\n    this.isFast = true;\n  }\n  next();\n})\nclass Car extends Typegoose {\n  @prop({ required: true })\n  model!: string;\n\n  @prop()\n  isFast?: boolean;\n}\n```\n\nThis will execute the pre-save hook each time a `Car` document is saved. Inside the pre-hook Mongoose binds the actual document to `this`.\n\nNote that additional typing information is required either by passing the class itself as a type parameter `\u003cCar\u003e` or explicity telling TypeScript that `this` is a `Car` (`this: Car`). This will grant typing informations inside the hook function.\n\n#### post\n\nSame as `pre`, the `post` hook is also implemented as a class decorator. Usage is equivalent with the one Mongoose provides.\n(Method supports REGEXP)\n\n```ts\n@post\u003cCar\u003e('save', (car) =\u003e {\n  if (car.topSpeedInKmH \u003e 300) {\n    console.log(car.model, 'is fast!');\n  }\n})\nclass Car extends Typegoose {\n  @prop({ required: true })\n  model!: string;\n\n  @prop({ required: true })\n  topSpeedInKmH!: number;\n}\n```\n\nOf course `this` is not the document in a post hook (see Mongoose docs). Again typing information is required either by explicit parameter typing or by providing a template type.\n\n#### plugin\n\nUsing the `plugin` decorator enables the developer to attach various Mongoose plugins to the schema. Just like the regular `schema.plugin()` call, the decorator accepts 1 or 2 parameters: the plugin itself, and an optional configuration object. Multiple `plugin` decorator can be used for a single Typegoose class.\n\nIf the plugin enhances the schema with additional properties or instance / static methods this typing information should be added manually to the Typegoose class as well.\n\n```ts\nimport * as findOrCreate from 'mongoose-findorcreate';\n\n@plugin(findOrCreate)\nclass User extends Typegoose {\n  // this isn't the complete method signature, just an example\n  static findOrCreate(condition: InstanceType\u003cUser\u003e):\n    Promise\u003c{ doc: InstanceType\u003cUser\u003e, created: boolean }\u003e;\n}\n\nconst UserModel = new User().getModelForClass(User);\nUserModel.findOrCreate({ ... }).then(findOrCreateResult =\u003e {\n  ...\n});\n```\n\n#### index\n\nThe `@index` decorator can be used to define advanced index types and index options not available via the\n`index` option of the `@prop` property decorator, such as compound indices, GeoJSON index types,\npartial indices, expiring documents, etc. Any values supported by\n[MongoDB's createIndex()](https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#db.collection.createIndex)\nare also valid for `@index`. For more info refer to interface `IndexOptions`\n\n ```ts\n@index({ article: 1, user: 1 }, { unique: true })\n@index({ location: '2dsphere' })\n@index({ article: 1 }, { partialFilterExpression: { stars: { $gte: 4.5 } } })\nexport class Location extends Typegoose {\n  @prop()\n  article?: number;\n\n  @prop()\n  user?: number;\n\n  @prop()\n  stars?: number;\n\n  @arrayProp({ items: Array })\n  location?: [[Number]]\n}\n```\n\n### Types\n\nSome additional types were added to make Typegoose more user friendly.\n\n#### InstanceType\u003cT\u003e\n\nThis is basically the logical 'and' of the `T` and the `mongoose.Document`, so that both the Mongoose instance properties/functions and the user defined properties/instance methods are available on the instance.\n\nNote: TypeScript has its own InstanceType, you should import it from Typegoose\n\n#### ModelType\u003cT\u003e\n\nThis is the logical 'and' of `mongoose.Model\u003cInstanceType\u003cT\u003e\u003e` and `T`, so that the Mongoose model creates `InstanceType\u003cT\u003e` typed instances and all user defined static methods are available on the model.\n\n#### Ref\u003cT\u003e\n\nFor reference properties:\n`Ref\u003cT\u003e` - `T` if populated and `ObjectID` if unpopulated.\n\n## Improvements\n\n* Add frequently used (currently not present) features if needed\n* Create more tests (break down current huge one into multiple unit tests)\n* Add Tests for:\n  - Hooks: add hook test for pre \u0026 post with error\n  - test for the errors (if invalid arguments are given)\n  - improve baseProp `required` handeling ()\n\n### Notes\n\n* `mongoose` is a peer-dependency, and a dev dependency to install it for dev purposes\n* Please dont add comments with `+1` or something like that, use the Reactions\n* Typegoose **cannot** be used with classes of the same name, it will always return the first build class with that name\n* All Models in Typegoose are set to strict by default, and **cant** be changed!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszokodiakos%2Ftypegoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszokodiakos%2Ftypegoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszokodiakos%2Ftypegoose/lists"}