Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@typegoose/typegoose

typegoose457kMIT12.14.0TypeScript support: included

Define Mongoose models using TypeScript classes

typegoose, mongoose, orm, mongodb, class, model, schema, odm

readme

Typegoose

(These badges are from typegoose:master)
Node.js Tests codecov.io npm

Define Mongoose models using TypeScript classes

Migration

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

Basic usage

import { prop, getModelForClass } from '@typegoose/typegoose';
import mongoose from 'mongoose';

class User {
  @prop()
  public name?: string;

  @prop({ type: () => [String] })
  public jobs?: string[];
}

const UserModel = getModelForClass(User); // UserModel is a regular Mongoose Model with correct types

(async () => {
  await mongoose.connect('mongodb://localhost:27017/', { dbName: 'test' });

  const { _id: id } = await UserModel.create({ name: 'JohnDoe', jobs: ['Cleaner'] });
  const user = await UserModel.findById(id).exec();

  console.log(user); // prints { _id: 59218f686409d670a97e53e0, name: 'JohnDoe', __v: 0 }
})();

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:

// This is a representation of how typegoose's compile output would look like
interface Car {
  model?: string;
}

interface Job {
  title?: string;
  position?: string;
}

interface User {
  name?: string;
  age!: number;
  preferences?: string[];
  mainJob?: Job;
  jobs?: Job[];
  mainCar?: Car | string;
  cars?: (Car | string)[];
}

const JobSchema = new mongoose.Schema({
  title: String;
  position: String;
});

const CarModel = mongoose.model('Car', {
  model: string,
});

const UserModel = mongoose.model('User', {
  name: { type: String },
  age: { type: Number, required: true },
  preferences: [{ type: String }],
  mainJob: { type: JobSchema },
  jobs: [{ type: JobSchema }],
  mainCar: { type: Schema.Types.ObjectId, ref: 'Car' },
  cars: [{ type: Schema.Types.ObjectId, ref: 'Car' }],
});

You can just write this:

class Job {
  @prop()
  public title?: string;

  @prop()
  public position?: string;
}

class Car {
  @prop()
  public model?: string;
}

class User {
  @prop()
  public name?: string;

  @prop({ required: true })
  public age!: number; // This is a single Primitive

  @prop({ type: () => [String] })
  public preferences?: string[]; // This is a Primitive Array

  @prop()
  public mainJob?: Job; // This is a single SubDocument

  @prop({ type: () => Job })
  public jobs?: Job[]; // This is a SubDocument Array

  @prop({ ref: () => Car })
  public mainCar?: Ref<Car>; // This is a single Reference

  @prop({ ref: () => Car })
  public cars?: Ref<Car>[]; // This is a Reference Array
}

Extra Examples


Requirements & Install

Typegoose's Quick Start Guide

Testing

yarn install
yarn 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

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.

changelog

12.14.0 (2025-03-25)

  • chore(deps): bump @babel/helpers from 7.26.9 to 7.26.10 in /website (#986) (6edf4f4), closes #986
  • chore(deps): bump @babel/runtime from 7.24.4 to 7.26.10 in /website (#985) (78f1b47), closes #985
  • chore(deps): bump @babel/runtime-corejs3 in /website (#987) (584e4d6), closes #987
  • chore(deps): bump cycjimmy/semantic-release-action from 4.1.0 to 4.2.0 (#984) (0abfd32), closes #984
  • chore(deps): bump prismjs from 1.29.0 to 1.30.0 in /website (20b36cb)
  • chore(workflows/tests): explicitly install "conventional-changelog-writer@8.0.1" (8ebf913)
  • chore(workflows/tests): remove default semantic-release plugins (3798764)
  • chore(workflows/website-pr): enable for all branches (2d13a47)
  • deps(mongoose): upgrade to 8.13.0 (cc25059)
  • devdeps(eslint-plugin-prettier): upgrade to 5.2.4 (4ebc94c)
  • devdeps(ts-jest): upgrade to 29.3.0 (68bceb5)
  • docs(known-issues): add section for esbuild (765cd86), closes #988
  • docs(known-issues): remove "@types/node breaking change" section (3d9d9c3)
  • Merge pull request #983 from typegoose/dependabot/npm_and_yarn/website/prismjs-1.30.0 (535744a), closes #983

12.13.0 (2025-03-04)

Dependencies

  • mongoose: upgrade to 8.12.0 (f1ee800)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.16 (09b5c54)
  • prettier: upgrade to 3.5.3 (6155413)

12.12.0 (2025-02-27)

Fixes

  • typegoose: move "isCachingEnabled" in "addModelToTypegoose" before assertions (8bfa8c4), closes #981

Dependencies

  • mongoose: upgrade to 8.11.0 (5ac66ac)

Dev-Dependencies

  • mongodb-memory-server: upgrade to 10.1.4 (9290abd)
  • prettier: upgrade to 3.5.2 (542ac77)
  • ts-jest: upgrade to 29.2.6 (7091dde)

12.11.0 (2025-02-08)

Features

  • infer "type: [TYPE]" as PropType.ARRAY, unless manually specified (68e5a37)

Dependencies

  • mongoose: upgrade to 8.10.0 (1daf0f7)
  • semver: upgrade to 7.7.1 (eef140a)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.15 (112747c)
  • eslint-plugin-prettier: upgrade to 5.2.3 (e2d77fe)
  • mongodb-memory-server: upgrade to 10.1.3 (e25bdb0)

12.10.2 (2025-02-08)

Fixes

  • logSettings: actually allow more levels than "warn" and "error" (e406af2)

12.10.1 (2024-12-14)

Fixes

  • logSettings: re-export used functions explicitly (b3dbe11)
  • logSettings: revert removing "import * as logger" (ca11619)

12.10.0 (2024-12-14)

Fixes

  • tsconfig: enable "esModuleInterop" (dc26ef8)

Style

  • change import style to use default imports (7f920be)
  • types: add "unknown[]" to "prop#type" to better convey intention (96229f1)
  • utils::lodash: change import style to use default imports (04847f7)

Dependencies

  • mongoose: upgrade to 8.9.0 (6f39022)

Dev-Dependencies

  • prettier: upgrade to 3.4.2 (cc6c4d5)

12.9.1 (2024-11-21)

Fixes

12.9.0 (2024-11-03)

Fixes

  • types: add "Default__v" type because of mongoose 8.8 (a3d1477)

Dependencies

  • mongoose: upgrade to 8.8.0 (306bcdd)
  • tslib: upgrade to 2.8.1 (add96f5)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.14 (ea96773)
  • @types/lodash: upgrade to 4.17.13 (25a1446)
  • mongodb-memory-server: upgrade to 10.1.2 (279b598)

12.9.0-beta.1 (2024-11-03)

Fixes

  • types: add "Default__v" type because of mongoose 8.8 (a3d1477)

Dependencies

  • mongoose: upgrade to 8.8.0 (306bcdd)
  • tslib: upgrade to 2.8.1 (add96f5)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.14 (ea96773)
  • @types/lodash: upgrade to 4.17.13 (25a1446)
  • mongodb-memory-server: upgrade to 10.1.2 (279b598)

12.8.0 (2024-09-28)

Dependencies

  • loglevel: upgrade to 1.9.2 (42d34c6)
  • mongoose: upgrade to 8.7.0 (d25ddf4)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.13 (8f737fc)
  • @types/lodash: upgrade to 4.17.9 (be6aba1)
  • eslint: upgrade to 8.57.1 (a3a08e3)
  • mongodb-memory-server: upgrade to 10.0.1 (5464812)

12.7.0 (2024-08-31)

Style

  • types: fix typo in BasePropOptions's autopopulate description (#952) (8613414)

Dependencies

  • mongoose: upgrade to 8.6.0 (d3cc8c0)
  • semver: upgrade to 7.6.3 (52c01b7)
  • tslib: upgrade to 2.7.0 (6cb1d44)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.7 (5ee6344)
  • eslint-plugin-prettier: upgrade to 5.2.1 (37a6774)
  • mongodb-memory-server: upgrade to 10.0.0 (f3097dd)
  • prettier: upgrade to 3.3.3 (f05c6d3)
  • rimraf: upgrade to 5.0.10 (357b04f)
  • ts-jest: upgrade to 29.2.5 (8ba7a22)

12.6.0 (2024-07-10)

Dependencies

  • mongoose: upgrade to 8.5.0 (8f3e4f6)
  • tslib: upgrade to 2.6.3 (f299ccc)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.6 (86b8a0f)
  • mongodb-memory-server: upgrade to 9.4.0 (578671e)
  • prettier: upgrade to 3.3.2 (1f6ccb1)
  • ts-jest: upgrade to 29.2.1 (f16d6f2)

12.5.0 (2024-05-19)

Dependencies

  • mongoose: upgrade to 8.4.0 (7a3e65e)
  • semver: upgrade to 7.6.2 (877b7da)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.4 (b4193fa)
  • rimraf: upgrade to 5.0.7 (54559a3)

12.4.0 (2024-04-22)

Dependencies

  • mongoose: upgrade to 8.3.1 (a431d3a)

Dev-Dependencies

  • jest-runner-tsd: upgrade to 6.0.0 (06ec544)
  • mongodb-memory-server: upgrade to 9.2.0 (f999238)

12.4.0-beta.2 (2024-04-15)

Fixes

12.4.0-beta.1 (2024-04-12)

Dependencies

  • mongoose: upgrade to 8.3.1 (a431d3a)

Dev-Dependencies

  • jest-runner-tsd: upgrade to 6.0.0 (06ec544)

12.3.1 (2024-04-15)

Fixes

12.3.0 (2024-04-06)

Features

  • add support for declaring search indexes (#921) (5246241)

Fixes

  • typegoose: update minimal node version check to match engines (a07c9ee)
  • typegoose: update mongoose version check for 8.2.4 (f197dbe)

Dependencies

  • mongoose: upgrade to 8.2.4 (f1e3dc7)
  • reflect-metadata: upgrade to 0.2.2 (1e4d282)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.0 (a536cb9)
  • @types/semver: upgrade to 7.5.8 (8757a20)
  • eslint: upgrade to 8.57.0 (7979a37)
  • mongodb-memory-server: upgrade to 9.1.8 (e287b6b)

12.3.0-beta.2 (2024-04-02)

Features

  • add support for declaring search indexes (#921) (5246241)

Fixes

  • typegoose: update minimal node version check to match engines (a07c9ee)
  • typegoose: update mongoose version check for 8.2.4 (f197dbe)

12.3.0-beta.1 (2024-03-30)

Dependencies

  • mongoose: upgrade to 8.2.4 (f1e3dc7)
  • reflect-metadata: upgrade to 0.2.2 (1e4d282)

Dev-Dependencies

  • @types/lodash: upgrade to 4.17.0 (a536cb9)
  • @types/semver: upgrade to 7.5.8 (8757a20)
  • eslint: upgrade to 8.57.0 (7979a37)
  • mongodb-memory-server: upgrade to 9.1.8 (e287b6b)

12.2.0 (2024-02-23)

Dependencies

  • loglevel: upgrade to 1.9.1 (f3455d1)
  • mongoose: upgrade to 8.2.0 (186328e)
  • semver: upgrade to 7.6.0 (1dcd4d2)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.12 (b176241)
  • @types/semver: upgrade to 7.5.7 (18482ba)
  • @typescript-eslint/*: upgrade to 6.21.0 (e3c333a)
  • mongodb-memory-server: upgrade to 9.1.6 (e81622f)
  • prettier: upgrade to 3.2.5 (a6b494c)
  • ts-jest: upgrade to 29.1.2 (cb72e87)

12.1.0 (2024-01-17)

Dependencies

  • mongoose: upgrade to 8.1.0 (99b3eca)
  • reflect-metadata: upgrade to 0.2.1 (0cc46a7)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.11 (db83044)
  • @typescript-eslint/*: upgrade to 6.19.0 (d48adfb)
  • commitlint: upgrade to 17.8.1 (77ed29f)
  • eslint-config-prettier: upgrade to 9.1.0 (97b7859)
  • eslint-plugin-prettier: upgrade to 5.1.3 (6536299)
  • eslint: upgrade to 8.56.0 (464cb26)
  • mongodb-memory-server: upgrade to 9.1.5 (432798b)
  • prettier: upgrade to 3.2.4 (91cdff8)
  • typescript: upgrade to 5.3.3 (6a821f8)

12.0.0 (2023-11-25)

⚠ BREAKING CHANGES

  • mongoose: mongoose 8.0.0 is now the version in use
  • tsconfig.json: tsconfig "target" is now "es2021" which could be potentially breaking
  • package.json: Minimal NodeJS version is now 16.20.1

Features

  • package.json: update nodejs version to 16.20 (8dd8467)
  • tsconfig.json: update "target" to match minimal NodeJS capabilities (ce3cf74)

Fixes

  • types::QueryHelperThis: provide generic "RawDocType" (74cdf28), closes #870 #870

Style

  • processProp: fix lint (db6042a)
  • types::EnumValues: remove some TODOs (5f0abf5)

Dependencies

  • mongoose: upgrade to 8.0.0 (fc16e81)
  • mongoose: upgrade to 8.0.1 (6223bf8)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.10 (ac2869a)
  • @types/jest: upgrade to 29.5.8 (571d2af)
  • @types/lodash: upgrade to 4.14.201 (9be7a9e)
  • @types/lodash: upgrade to 4.14.202 (3868481)
  • @types/node: upgrade to 16.11.7 (e0de5a1)
  • @types/semver: upgrade to 7.5.5 (1bdd67b)
  • @types/semver: upgrade to 7.5.6 (f96c647)
  • @typescript-eslint/*: upgrade to 6.11.0 (470cae7)
  • @typescript-eslint/*: upgrade to 6.12.0 (df34158)
  • @typescript-eslint/*: upgrade to 6.9.1 (1e7784d)
  • eslint: upgrade to 8.53.0 (f8a1573)
  • eslint: upgrade to 8.54.0 (61a7124)
  • jest-runner-tsd: upgrade to 5.0.0 (9d2dc2d)
  • lint-staged: upgrade to 14.0.1 (b77a092)
  • mongodb-memory-server: upgrade to 9.1.1 (e57d841)
  • prettier: upgrade to 3.1.0 (433488b)
  • typescript: upgrade to 5.2.2 (e5ce00b)

12.0.0-beta.1 (2023-11-16)

⚠ BREAKING CHANGES

  • mongoose: mongoose 8.0.0 is now the version in use
  • tsconfig.json: tsconfig "target" is now "es2021" which could be potentially breaking
  • package.json: Minimal NodeJS version is now 16.20.1

Features

  • package.json: update nodejs version to 16.20 (8dd8467)
  • tsconfig.json: update "target" to match minimal NodeJS capabilities (ce3cf74)

Fixes

  • types::QueryHelperThis: provide generic "RawDocType" (74cdf28), closes #870 #870

Style

  • processProp: fix lint (db6042a)
  • types::EnumValues: remove some TODOs (5f0abf5)

Dependencies

  • mongoose: upgrade to 8.0.0 (fc16e81)
  • mongoose: upgrade to 8.0.1 (6223bf8)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.8 (571d2af)
  • @types/lodash: upgrade to 4.14.201 (9be7a9e)
  • @types/node: upgrade to 16.11.7 (e0de5a1)
  • @types/semver: upgrade to 7.5.5 (1bdd67b)
  • @typescript-eslint/*: upgrade to 6.11.0 (470cae7)
  • @typescript-eslint/*: upgrade to 6.9.1 (1e7784d)
  • eslint: upgrade to 8.53.0 (f8a1573)
  • jest-runner-tsd: upgrade to 5.0.0 (9d2dc2d)
  • lint-staged: upgrade to 14.0.1 (b77a092)
  • prettier: upgrade to 3.1.0 (433488b)
  • typescript: upgrade to 5.2.2 (e5ce00b)

11.8.0 (2024-07-26)

Style

Dependencies

  • loglevel: upgrade to 1.9.1 (0bc6ba5)
  • mongoose: upgrade to 7.8.0 (aca3a8c)
  • reflect-metadata: upgrade to 0.1.14 (fea8cb9)
  • semver: upgrade to 7.6.2 (ed8ca90)
  • tslib: upgrade to 2.6.3 (874a9a4)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.12 (3b324bd)
  • @types/lodash: upgrade to 4.17.6 (d14ea23)
  • @types/semver: upgrade to 7.5.8 (7e13171)
  • commitlint: upgrade to 17.8.1 (869183e)
  • eslint-config-prettier: upgrade to 9.1.0 (50ad085)
  • eslint-plugin-prettier: upgrade to 5.1.3 (0df5265)
  • eslint: upgrade to 8.57.0 (f68f830)
  • mongodb-memory-server: upgrade to 9.4.0 (7731371)
  • prettier: upgrade to 3.3.2 (031aac7)
  • rimraf: upgrade to 5.0.9 (24e6a64)
  • ts-jest: upgrade to 29.2.1 (58158f4)

11.7.1 (2023-11-16)

Fixes

  • types::QueryHelperThis: provide generic "RawDocType" (ff778ea), closes #870 #870

11.7.0 (2023-11-03)

Features

  • dont inherit typegoose option "disableLowerIndexes" (7706715)
  • hooks: update hook definitions to match mongoose 7.6.2 (c97bb88)
  • typegoose::buildSchema: correctly get and set "superOptions" if the top level class sets it (717a60c), closes typegoose/typegoose#890

Fixes

  • utils::mergeMetadata: add options to use "getOwnMetadata" instead of "getMetadata" (148983b)

Style

  • typegoose::buildSchema: rename variable to make more sense (ca4863c)

Dependencies

  • mongoose: upgrade to 7.6.3 (c9399f2)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.6 (375057a)
  • @types/lodash: upgrade to 4.14.200 (ab70e0c)
  • @types/semver: upgrade to 7.5.4 (a86d143)
  • eslint-plugin-prettier: upgrade to 5.0.1 (80f448f)
  • eslint: upgrade to 8.52.0 (feecd5f)
  • mongodb-memory-server: upgrade to 9.0.1 (22c233d)

11.7.0-beta.1 (2023-10-30)

Features

  • dont inherit typegoose option "disableLowerIndexes" (7706715)
  • hooks: update hook definitions to match mongoose 7.6.2 (c97bb88)
  • typegoose::buildSchema: correctly get and set "superOptions" if the top level class sets it (717a60c), closes typegoose/typegoose#890

Fixes

  • utils::mergeMetadata: add options to use "getOwnMetadata" instead of "getMetadata" (148983b)

Style

  • typegoose::buildSchema: rename variable to make more sense (ca4863c)

Dependencies

  • mongoose: upgrade to 7.6.3 (c9399f2)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.6 (375057a)
  • @types/lodash: upgrade to 4.14.200 (ab70e0c)
  • @types/semver: upgrade to 7.5.4 (a86d143)
  • eslint-plugin-prettier: upgrade to 5.0.1 (80f448f)
  • eslint: upgrade to 8.52.0 (feecd5f)
  • mongodb-memory-server: upgrade to 9.0.1 (22c233d)

11.6.0 (2023-10-10)

Dependencies

  • mongoose: upgrade to 7.6.1 (61ae900)

11.5.1 (2023-10-07)

Style

  • apply prettier 3.0 formatting changes (07826fa)

Dev-Dependencies

  • @types/jest: upgrade to 29.5.5 (e1a1a9f)
  • @types/lodash: upgrade to 4.14.199 (0985e4f)
  • @types/node: upgrade to 14.18.63 (f62f379)
  • @types/semver: upgrade to 7.5.3 (41683d7)
  • @typescript-eslint/*: upgrade to 5.62.0 (2b84106)
  • commitlint: upgrade to 17.7.2 (bad796b)
  • eslint-config-prettier: upgrade to 8.10.0 (a15c884)
  • eslint-config-prettier: upgrade to 9.0.0 (93e3f85)
  • eslint: upgrade to 8.51.0 (5313ded)
  • jest: upgrade to 29.7.0 (13d92f7)
  • mongodb-memory-server: upgrade to 9.0.0 (88df9ab)
  • prettier: upgrade to 3.0.3 (7c198cd)
  • rimraf: upgrade to 5.0.5 (b72f5c6)

11.5.0 (2023-09-01)

Dependencies

  • @types/jest: upgrade to 29.5.4 (ab2ab5e)
  • @types/lodash: upgrade to 4.14.197 (27e1ce1)
  • @types/semver: upgrade to 7.5.1 (84aa0f2)
  • commitlint: upgrade to 17.7.1 (ae0c1f6)
  • eslint: upgrade to 8.48.0 (03efd47)
  • jest: upgrade to 29.6.4 (51d5112)
  • mongodb-memory-server: upgrade to 8.15.1 (4501d7e)
  • mongoose: upgrade to 7.5.0 (9a59535)
  • tslib: upgrade to 2.6.2 (0e839ff)

10.5.0 (2023-09-01)

Dependencies

  • @types/jest: upgrade to 29.5.4 (9ba93c1)
  • @types/lodash: upgrade to 4.14.197 (70c77e6)
  • @types/semver: upgrade to 7.5.1 (96824e8)
  • @typescript-eslint/*: upgrade to 5.62.0 (00f3265)
  • commitlint: upgrade to 17.7.1 (85d2c31)
  • eslint-config-prettier: upgrade to 8.10.0 (1b3b2af)
  • eslint: upgrade to 8.48.0 (9b16f59)
  • jest: upgrade to 29.6.4 (bc52aff)
  • mongodb-memory-server: upgrade to 8.15.1 (1f3ee1b)
  • mongoose: upgrade to 6.12.0 (0f11694)
  • semver: upgrade to 7.5.4 (ec121a9)
  • ts-jest: upgrade to 29.1.1 (52a35f2)
  • tslib: upgrade to 2.6.2 (3c5fd4b)

11.4.1 (2023-08-02)

Fixes

  • types::QueryHelperThis: use InstanceType<T> instead of T (b9cf61f)

11.4.0 (2023-07-19)

Dependencies

  • @types/jest: upgrade to 29.5.3 (f9dec27)
  • commitlint: upgrade to 17.6.7 (c211481)
  • eslint: upgrade to 8.45.0 (7c119d4)
  • jest: upgrade to 29.6.1 (171f22d)
  • lint-staged: upgrade to 13.2.3 (0951c02)
  • mongoose: upgrade to 7.4.0 (6ee5ace)
  • semver: upgrade to 7.5.4 (962f6b9)
  • ts-jest: upgrade to 29.1.1 (9a1eff8)
  • tslib: upgrade to 2.6.0 (ad83bc1)

11.3.0 (2023-06-17)

Style

  • website/fetch_versions: disable eslint rule for function (187a7f1)

Dependencies

  • @semantic-release/github: upgrade to 8.1.0 (55a64d9)
  • @types/jest: upgrade to 29.5.2 (ced9aee)
  • @types/lodash: upgrade to 4.14.195 (c5c57fd)
  • @types/node: upgrade to 14.18.48 (ec31169)
  • @types/node: upgrade to 14.18.51 (79ff1cc)
  • @typescript-eslint/*: upgrade to 5.59.11 (13947d4)
  • @typescript-eslint/*: upgrade to 5.59.8 (39db711)
  • commitlint: upgrade to 17.6.5 (d94e87f)
  • eslint: upgrade to 8.42.0 (476375e)
  • eslint: upgrade to 8.43.0 (25ac895)
  • mongodb-memory-server: upgrade to 8.13.0 (55c501f)
  • mongoose: upgrade to 7.2.3 (e0374bd), closes typegoose/typegoose#846
  • mongoose: upgrade to 7.3.0 (e78ce78)
  • rimraf: upgrade to 5.0.1 (227bc3c)
  • semver: upgrade to 7.5.2 (84934a0)
  • tslib: upgrade to 2.5.3 (1fcdc17)

11.3.0-beta.3 (2023-06-17)

Dependencies

  • @types/node: upgrade to 14.18.51 (79ff1cc)
  • eslint: upgrade to 8.43.0 (25ac895)
  • rimraf: upgrade to 5.0.1 (227bc3c)

11.3.0-beta.2 (2023-06-16)

Style

  • website/fetch_versions: disable eslint rule for function (187a7f1)

11.3.0-beta.1 (2023-06-16)

Dependencies

  • @semantic-release/github: upgrade to 8.1.0 (55a64d9)
  • @types/jest: upgrade to 29.5.2 (ced9aee)
  • @types/lodash: upgrade to 4.14.195 (c5c57fd)
  • @types/node: upgrade to 14.18.48 (ec31169)
  • @typescript-eslint/*: upgrade to 5.59.11 (13947d4)
  • @typescript-eslint/*: upgrade to 5.59.8 (39db711)
  • commitlint: upgrade to 17.6.5 (d94e87f)
  • eslint: upgrade to 8.42.0 (476375e)
  • mongodb-memory-server: upgrade to 8.13.0 (55c501f)
  • mongoose: upgrade to 7.2.3 (e0374bd), closes typegoose/typegoose#846
  • mongoose: upgrade to 7.3.0 (e78ce78)
  • semver: upgrade to 7.5.2 (84934a0)
  • tslib: upgrade to 2.5.3 (1fcdc17)

11.2.0 (2023-05-20)

Features

  • support "enum" being a deferred function (3b754f0)

Reverts

  • Revert "dependencies(@types/node): upgrade to 16.11.7" (90c5fde)

Fixes

  • allow usage and translation of "enum: { values: Type }" (3ca1d5f)

Dependencies

  • @types/lodash: upgrade to 4.14.192 (b9ec3fe)
  • @types/node: upgrade to 14.18.45 (502436a)
  • @types/semver: upgrade to 7.5.0 (162d0a6)
  • @typescript-eslint/*: upgrade to 5.57.0 (ed40301)
  • @typescript-eslint/*: upgrade to 5.59.6 (b4c7760)
  • commitlint: upgrade to 17.5.1 (1a3db22)
  • commitlint: upgrade to 17.6.3 (4181605)
  • eslint: upgrade to 8.37.0 (62cac9f)
  • eslint: upgrade to 8.41.0 (e2f55d7)
  • mongoose: upgrade to 7.2.0 (c53fa61)
  • semver: upgrade to 7.5.1 (0b929d2)
  • tslib: upgrade to 2.5.2 (1c9b9cb)

11.2.0-beta.2 (2023-05-20)

Dependencies

  • @types/semver: upgrade to 7.5.0 (162d0a6)
  • @typescript-eslint/*: upgrade to 5.59.6 (b4c7760)
  • commitlint: upgrade to 17.6.3 (4181605)
  • eslint: upgrade to 8.41.0 (e2f55d7)
  • mongoose: upgrade to 7.2.0 (c53fa61)
  • semver: upgrade to 7.5.1 (0b929d2)
  • tslib: upgrade to 2.5.2 (1c9b9cb)

11.2.0-beta.1 (2023-05-08)

Features

  • support "enum" being a deferred function (3b754f0)

Reverts

  • Revert "dependencies(@types/node): upgrade to 16.11.7" (90c5fde)

Fixes

  • allow usage and translation of "enum: { values: Type }" (3ca1d5f)

Dependencies

  • @types/lodash: upgrade to 4.14.192 (b9ec3fe)
  • @types/node: upgrade to 14.18.45 (502436a)
  • @typescript-eslint/*: upgrade to 5.57.0 (ed40301)
  • commitlint: upgrade to 17.5.1 (1a3db22)
  • eslint: upgrade to 8.37.0 (62cac9f)

10.4.0 (2023-05-02)

Dependencies

  • @semantic-release/changelog: upgrade to 6.0.3 (07ef745)
  • @types/jest: upgrade to 29.5.1 (32926b1)
  • @types/lodash: upgrade to 4.14.194 (74e3e30)
  • @typescript-eslint/*: upgrade to 5.59.2 (799fcf6)
  • commitlint: upgrade to 17.6.1 (6242a75)
  • eslint-config-prettier: upgrade to 8.8.0 (de27921)
  • eslint: upgrade to 8.39.0 (cb6000a)
  • jest: upgrade to 29.5.0 (e2512c9)
  • lint-staged: upgrade to 13.2.2 (380cb76)
  • mongodb-memory-server: upgrade to 8.12.2 (950fa0b)
  • mongoose: upgrade to 6.11.0 (a392262)
  • prettier: upgrade to 2.8.8 (354be24)
  • semver: upgrade to 7.5.0 (e57bd3b)
  • ts-jest: upgrade to 29.1.0 (cfb66bd)

Style

  • test::model::typeguards: add comments noting that a type is meant to be (269cf7f)

Fixes

11.1.0 (2023-04-29)

Note: when updating to this version, @types/node@16 is required (instead of the previous @14)

Dependencies

  • @types/jest: upgrade to 29.5.1 (16000b5)
  • @types/lodash: upgrade to 4.14.194 (19dda46)
  • @types/node: upgrade to 16.11.7 (d2739b9)
  • @typescript-eslint/*: upgrade to 5.59.1 (0b5ed3a)
  • commitlint: upgrade to 17.6.1 (19b9ffd)
  • eslint: upgrade to 8.39.0 (ca7d21e)
  • lint-staged: upgrade to 13.2.2 (056eb2c)
  • mongodb-memory-server: upgrade to 8.12.2 (dd03def)
  • mongoose: upgrade to 7.1.0 (017b7a1)
  • prettier: upgrade to 2.8.8 (e84fd4e)
  • semver: upgrade to 7.5.0 (9c09ed6)
  • ts-jest: upgrade to 29.1.0 (69be082)

11.0.3 (2023-04-27)

Fixes

11.0.2 (2023-04-19)

Fixes

  • types: add helper type "FilterOutFunctionKeys" (ce91f29)

11.0.1 (2023-04-15)

Fixes

  • typegoose::getDiscriminatorModelForClass: fix "from" type for models with different _id type (fb752fc)

11.0.0 (2023-03-27)

⚠ BREAKING CHANGES

  • mongoose: mongoose 7.0.0 is now in use
  • Default-Class "FindOrCreate" (and type "FindOrCreateResult") has been removed, because mongoose-findorcreate is not compatible with mongoose 7.0

Features

  • remove usage and references to "mongoose-findorcreate" (6de3aa9)

Fixes

  • update types and type-tests for mongoose 7.0 (b3df459)

Style

  • hooks: update version notice (02fc3bb)
  • test::model::typeguards: add comments noting that a type is meant to be (6aa8f17)

Dependencies

  • @semantic-release/changelog: upgrade to 6.0.3 (3196d08)
  • @types/jest: upgrade to 29.5.0 (a2aeefb)
  • @typescript-eslint/*: upgrade to 5.55.0 (40d882f)
  • @typescript-eslint/*: upgrade to 5.56.0 (0116947)
  • commitlint: upgrade to 17.5.0 (d7986a1)
  • eslint-config-prettier: upgrade to 8.7.0 (9394fcf)
  • eslint-config-prettier: upgrade to 8.8.0 (25bfc89)
  • eslint: upgrade to 8.36.0 (4b1db7a)
  • jest: upgrade to 29.5.0 (50491f0)
  • lint-staged: upgrade to 13.2.0 (4417d74)
  • mongodb-memory-server: upgrade to 9.12.1 (fd2874b)
  • mongoose: upgrade to 7.0.0 (0e06ec9)
  • mongoose: upgrade to 7.0.2 (bedb61d)
  • mongoose: upgrade to 7.0.3 (8e964ea)
  • prettier: upgrade to 2.8.7 (c72bd0c)
  • rimraf: upgrade to 4.1.2 (88181b6)
  • rimraf: upgrade to 4.4.0 (3395239)
  • rimraf: upgrade to 4.4.1 (f23b668)

11.0.0-beta.3 (2023-03-27)

Style

Dependencies

  • @semantic-release/changelog: upgrade to 6.0.3 (3196d08)
  • @typescript-eslint/*: upgrade to 5.56.0 (0116947)
  • commitlint: upgrade to 17.5.0 (d7986a1)
  • eslint-config-prettier: upgrade to 8.8.0 (25bfc89)
  • mongoose: upgrade to 7.0.3 (8e964ea)
  • prettier: upgrade to 2.8.7 (c72bd0c)
  • rimraf: upgrade to 4.4.1 (f23b668)

11.0.0-beta.2 (2023-03-19)

Fixes

  • errors: update E004 message and example (c777def)
  • globalOptions: another fix to check for "process" being undefined (5d81464)
  • typegoose: fix "process" variable checking for being undefined on browser (39743e2)

Dependencies

  • @types/jest: upgrade to 29.5.0 (a2aeefb)
  • @typescript-eslint/*: upgrade to 5.55.0 (40d882f)
  • eslint-config-prettier: upgrade to 8.7.0 (9394fcf)
  • eslint: upgrade to 8.36.0 (4b1db7a)
  • jest: upgrade to 29.5.0 (50491f0)
  • lint-staged: upgrade to 13.2.0 (4417d74)
  • mongodb-memory-server: upgrade to 9.12.1 (fd2874b)
  • mongoose: upgrade to 7.0.2 (bedb61d)
  • rimraf: upgrade to 4.4.0 (3395239)

11.0.0-beta.1 (2023-03-03)

⚠ BREAKING CHANGES

  • mongoose: mongoose 7.0.0 is now in use
  • Default-Class "FindOrCreate" (and type "FindOrCreateResult") has been removed, because mongoose-findorcreate is not compatible with mongoose 7.0

Features

  • remove usage and references to "mongoose-findorcreate" (6de3aa9)

Dependencies

  • mongoose: upgrade to 7.0.0 (0e06ec9)
  • rimraf: upgrade to 4.1.2 (88181b6)

Fixes

  • update types and type-tests for mongoose 7.0 (b3df459)

Style

  • hooks: update version notice (02fc3bb)
  • test::model::typeguards: add comments noting that a type is meant to be (6aa8f17)

10.3.4 (2023-03-23)

Style

10.3.3 (2023-03-18)

Fixes

  • errors: update E004 message and example (c777def)

10.3.2 (2023-03-13)

Fixes

  • globalOptions: another fix to check for "process" being undefined (5d81464)

10.3.1 (2023-03-13)

Fixes

  • typegoose: fix "process" variable checking for being undefined on browser (39743e2)

10.3.0 (2023-02-28)

Features

Fixes

  • rename global "disableCaching" to "disableGlobalCaching" (5deb0eb)

Style

  • types: update tsdoc example for "DocumentType" (33fa48e)

Dependencies

  • @typescript-eslint/*: upgrade to 5.52.0 (97cc0b1)
  • @typescript-eslint/*: upgrade to 5.54.0 (5c08a5c)
  • commitlint: upgrade to 17.4.4 (c696ac2)
  • eslint: upgrade to 8.34.0 (7c51f83)
  • eslint: upgrade to 8.35.0 (0dce134)
  • jest: upgrade to 29.4.3 (d7ab126)
  • lint-staged: upgrade to 13.1.2 (6c4ce7e)
  • prettier: upgrade to 2.8.4 (9fd5e78)
  • typescript: upgrade to 4.9.5 (27a1838)

10.2.0 (2023-02-23)

Dependencies

  • @typescript-eslint/*: upgrade to 5.53.0 (d1fda7b)
  • commitlint: upgrade to 17.4.4 (1399451)
  • eslint: upgrade to 8.34.0 (0585e4c)
  • jest: upgrade to 29.4.3 (c369561)
  • lint-staged: upgrade to 13.1.2 (e1bd015)
  • mongodb-memory-server: upgrade to 8.11.5 (502a3c8)
  • mongoose: upgrade to 6.10.0 (33558f7)
  • prettier: upgrade to 2.8.4 (382d82c)
  • typescript: upgrade to 4.9.5 (92b6779)

10.2.0-beta.3 (2023-02-19)

Features

  • types: change "DocumentType" to actually use a proper "_id" type (c63c5f1)

Dependencies

  • @typescript-eslint/*: upgrade to 5.52.0 (97cc0b1)
  • commitlint: upgrade to 17.4.4 (c696ac2)
  • eslint: upgrade to 8.34.0 (7c51f83)
  • jest: upgrade to 29.4.3 (d7ab126)
  • lint-staged: upgrade to 13.1.2 (6c4ce7e)
  • prettier: upgrade to 2.8.4 (9fd5e78)
  • typescript: upgrade to 4.9.5 (27a1838)

Style

  • types: update tsdoc example for "DocumentType" (33fa48e)

10.2.0-beta.2 (2023-02-09)

Features

  • add option to locally disable caching (78ac3bc)

Fixes

  • rename global "disableCaching" to "disableGlobalCaching" (5deb0eb)

10.2.0-beta.1 (2023-02-07)

Features

10.1.1 (2023-02-05)

Fixes

10.1.0 (2023-01-29)

Dependencies

  • @semantic-release/npm: upgrade to 9.0.2 (44633e4)
  • @types/jest: upgrade to 29.4.0 (424ba45)
  • @typescript-eslint/*: upgrade to 5.49.0 (108630d)
  • commitlint: upgrade to 17.4.2 (22b0881)
  • eslint-config-prettier: upgrade to 8.6.0 (144aaa6)
  • eslint: upgrade to 8.32.0 (eb047d1)
  • husky: upgrade to 8.0.3 (c4fe8a2)
  • jest: upgrade to 29.4.1 (b97b56f)
  • mongodb-memory-server: upgrade to 8.11.4 (24e6ca3)
  • mongoose: upgrade to 6.9.0 (14239a6)
  • prettier: upgrade to 2.8.3 (f691573)
  • ts-jest: upgrade to 29.0.5 (0b45b90)
  • tslib: upgrade to 2.5.0 (b463238)

10.0.0 (2022-12-12)

⚠ BREAKING CHANGES

  • typegoose::buildSchema: "buildSchema" now only accepts 2 parameters instead of 3 (the last 2 got merged)
  • Option "runSyncIndexes" has been removed, if still wanting to continue to use it, run "model.syncIndexes()" manually
  • File "index(.ts|.js)" got renamed to "indexes(.ts|.js)" to lessen confusion
  • utils: Function "getClassForDocument" is removed, use "getClass" directly
  • types::IndexOptions: Anyone using "@index" or "IndexOptions" directly with a generic will have to remove the generic
  • "DecoratedPropertyMetadata::whatis" got renamed to "DecoratedPropertyMetadata::propType" for anyone using it
  • tsconfig.json: tsconfig "target" is now "es2020" which could be potentially be breaking
  • NodeJS 14.0 is now the lowest required node version
  • types::Ref: "Ref" now transparently uses "DocumentType", which could lead ot breaking changes. "isDocumentType" and "isRefType" now narrow out the type that is tested, which could be a breaking change.
  • tsconfig.json: tsconfig "target" is now "es2019" which could be potentially be breaking

Features

Refactor

  • hooks: dont define empty hooks options if not provided (89b9416)
  • hooks: use mongoose's array looping over methods over typegoose's (ca2a03a), closes typegoose/typegoose#587
  • utils::initProperty: simplify paths (37ca83e)
  • update minimal NodeJS version to 14.0.0 (fcffbd8)

Fixes

  • hooks: update types for new "errorHandler" option (f52ea0d)
  • plugin: actually print "anonymous" if function name is empty (ae124bc)
  • typegoose: lessen the amount of "merge*" calls (e30f4ae)

Style

  • biguser.test: fix type error for "toMatchSnapshot" missing property "_id" (b7e86eb)
  • hooks: update types to more closely match mongoose's (62e1f2b), closes typegoose/typegoose#587
  • schema: remove test todo (8a3a296)
  • schema: update comment explaining on why "as any" is used for hooks (3e0386b)
  • typegoose: rename some internal variables (fc04892)
  • types::DecoratedPropertyMetadata: change "options" to have proper type instead of "any" (845c5e0)
  • types::EmptyVoidFn: remove unused type (2e79801)
  • types::IndexOptions: remove unused generic (5ed9f25)
  • types: fix typescript complaining about a tsdoc link (90fca45)
  • types: remove deprecated temporary options from "ICustomOptions" (932cce5)
  • types: remove type "IObjectWithTypegooseName" (67e8350)
  • utils::getClass: update types to better reflect what it is doing (a9a23f6)
  • utils::getClass: update types to use less duplicate types (5435d88)
  • utils: remove unused imports (4b79a49)

Dependencies

  • @semantic-release/changelog: upgrade to 6.0.2 (91ef4b4)
  • @semantic-release/github: upgrade to 8.0.7 (ece0c7e)
  • @types/jest: upgrade to 29.2.4 (296960a)
  • @types/lodash: upgrade to 4.14.190 (57233c9)
  • @types/lodash: upgrade to 4.14.191 (99df11d)
  • @types/node: upgrade to 14.14.31 (9f150d4)
  • @typescript-eslint/*: upgrade to 5.44.0 (70ab1bb)
  • @typescript-eslint/*: upgrade to 5.45.0 (58f19ca)
  • @typescript-eslint/*: upgrade to 5.46.0 (75576a0)
  • commitlint: upgrade to 17.3.0 (ee9fc80)
  • eslint: upgrade to 8.28.0 (ddcd191)
  • eslint: upgrade to 8.29.0 (8cb5c46)
  • husky: upgrade to 8.0.2 (4e1c894)
  • jest: upgrade to 29.0.3 (4252897)
  • lint-staged: upgrade to 13.0.4 (31f082c)
  • lint-staged: upgrade to 13.1.0 (b904e07)
  • mongodb-memory-server: upgrade to 8.10.1 (287dda8)
  • mongodb-memory-server: upgrade to 8.10.2 (12b257d)
  • mongoose: upgrade to 6.7.3 (f3870ff)
  • mongoose: upgrade to 6.7.5 (f68226e)
  • mongoose: upgrade to 6.8.0 (8e8958f)
  • prettier: upgrade to 2.8.0 (9328043)
  • prettier: upgrade to 2.8.1 (a8a7513)
  • semantic-release: upgrade to 19.0.5 (3d9175e)
  • typescript: upgrade to 4.9.3 (cfca616)
  • typescript: upgrade to 4.9.4 (1698424)

10.0.0-beta.3 (2022-12-12)

Style

  • schema: remove test todo (8a3a296)

Dependencies

  • @types/jest: upgrade to 29.2.4 (296960a)
  • @typescript-eslint/*: upgrade to 5.46.0 (75576a0)
  • eslint: upgrade to 8.29.0 (8cb5c46)
  • lint-staged: upgrade to 13.1.0 (b904e07)
  • mongodb-memory-server: upgrade to 8.10.2 (12b257d)
  • prettier: upgrade to 2.8.1 (a8a7513)
  • typescript: upgrade to 4.9.4 (1698424)

10.0.0-beta.2 (2022-12-06)

Dependencies

  • mongoose: upgrade to 6.8.0 (8e8958f)

Fixes

  • hooks: update types for new "errorHandler" option (f52ea0d)

10.0.0-beta.1 (2022-12-01)

⚠ BREAKING CHANGES

  • typegoose::buildSchema: "buildSchema" now only accepts 2 parameters instead of 3 (the last 2 got merged)
  • Option "runSyncIndexes" has been removed, if still wanting to continue to use it, run "model.syncIndexes()" manually
  • File "index(.ts|.js)" got renamed to "indexes(.ts|.js)" to lessen confusion
  • utils: Function "getClassForDocument" is removed, use "getClass" directly
  • types::IndexOptions: Anyone using "@index" or "IndexOptions" directly with a generic will have to remove the generic
  • "DecoratedPropertyMetadata::whatis" got renamed to "DecoratedPropertyMetadata::propType" for anyone using it
  • tsconfig.json: tsconfig "target" is now "es2020" which could be potentially be breaking
  • NodeJS 14.0 is now the lowest required node version
  • types::Ref: "Ref" now transparently uses "DocumentType", which could lead ot breaking changes. "isDocumentType" and "isRefType" now narrow out the type that is tested, which could be a breaking change.
  • tsconfig.json: tsconfig "target" is now "es2019" which could be potentially be breaking

Features

Refactor

  • hooks: dont define empty hooks options if not provided (89b9416)
  • hooks: use mongoose's array looping over methods over typegoose's (ca2a03a), closes typegoose/typegoose#587
  • utils::initProperty: simplify paths (37ca83e)
  • update minimal NodeJS version to 14.0.0 (fcffbd8)

Fixes

  • plugin: actually print "anonymous" if function name is empty (ae124bc)
  • typegoose: lessen the amount of "merge*" calls (e30f4ae)

Style

  • biguser.test: fix type error for "toMatchSnapshot" missing property "_id" (b7e86eb)
  • hooks: update types to more closely match mongoose's (62e1f2b), closes typegoose/typegoose#587
  • schema: update comment explaining on why "as any" is used for hooks (3e0386b)
  • typegoose: rename some internal variables (fc04892)
  • types::DecoratedPropertyMetadata: change "options" to have proper type instead of "any" (845c5e0)
  • types::EmptyVoidFn: remove unused type (2e79801)
  • types::IndexOptions: remove unused generic (5ed9f25)
  • types: fix typescript complaining about a tsdoc link (90fca45)
  • types: remove deprecated temporary options from "ICustomOptions" (932cce5)
  • types: remove type "IObjectWithTypegooseName" (67e8350)
  • utils::getClass: update types to better reflect what it is doing (a9a23f6)
  • utils::getClass: update types to use less duplicate types (5435d88)
  • utils: remove unused imports (4b79a49)

Dependencies

  • @semantic-release/changelog: upgrade to 6.0.2 (91ef4b4)
  • @semantic-release/github: upgrade to 8.0.7 (ece0c7e)
  • @types/lodash: upgrade to 4.14.190 (57233c9)
  • @types/lodash: upgrade to 4.14.191 (99df11d)
  • @types/node: upgrade to 14.14.31 (9f150d4)
  • @typescript-eslint/*: upgrade to 5.44.0 (70ab1bb)
  • @typescript-eslint/*: upgrade to 5.45.0 (58f19ca)
  • commitlint: upgrade to 17.3.0 (ee9fc80)
  • eslint: upgrade to 8.28.0 (ddcd191)
  • husky: upgrade to 8.0.2 (4e1c894)
  • jest: upgrade to 29.0.3 (4252897)
  • lint-staged: upgrade to 13.0.4 (31f082c)
  • mongodb-memory-server: upgrade to 8.10.1 (287dda8)
  • mongoose: upgrade to 6.7.3 (f3870ff)
  • mongoose: upgrade to 6.7.5 (f68226e)
  • prettier: upgrade to 2.8.0 (9328043)
  • semantic-release: upgrade to 19.0.5 (3d9175e)
  • typescript: upgrade to 4.9.3 (cfca616)

9.13.2 (2022-12-01)

Fixes

  • deprecate option "runSyncIndexes" (40f6d30)

9.13.1 (2022-11-24)

Fixes

  • typeguards: quick fix for typescript 4.9 (df36c34), closes #772

9.13.0 (2022-11-22)

Features

Dependencies

  • @types/lodash: upgrade to 4.14.186 (8367452)
  • @types/lodash: upgrade to 4.14.189 (6257223)
  • @types/semver: upgrade to 7.3.13 (9c7a151)
  • @typescript-eslint/*: upgrade to 5.41.0 (e10e53a)
  • @typescript-eslint/*: upgrade to 5.43.0 (851163f)
  • eslint: upgrade to 8.26.0 (187c843)
  • eslint: upgrade to 8.27.0 (436036a)
  • loglevel: upgrade to 1.8.1 (b017f76)
  • mongodb-memory-server: upgrade to 8.10.0 (79242e6)
  • mongodb-memory-server: upgrade to 8.9.3 (1725f65)
  • mongoose: upgrade to 6.7.0 (d5fa0e0)
  • mongoose: upgrade to 6.7.2 (d1e83f7)
  • semver: upgrade to 7.3.8 (7dc8138)
  • tslib: upgrade to 2.4.1 (9da2600)
  • typescript: upgrade to 4.8.4 (6590961), closes #644

Style

  • dbIndex.test: remove unused imports (7c1c7be)

9.13.0-beta.2 (2022-11-17)

Features

Dependencies

  • @types/lodash: upgrade to 4.14.189 (6257223)
  • @typescript-eslint/*: upgrade to 5.43.0 (851163f)
  • eslint: upgrade to 8.27.0 (436036a)
  • loglevel: upgrade to 1.8.1 (b017f76)
  • mongodb-memory-server: upgrade to 8.10.0 (79242e6)
  • mongoose: upgrade to 6.7.2 (d1e83f7)
  • tslib: upgrade to 2.4.1 (9da2600)

9.13.0-beta.1 (2022-10-27)

Dependencies

  • @types/lodash: upgrade to 4.14.186 (8367452)
  • @types/semver: upgrade to 7.3.13 (9c7a151)
  • @typescript-eslint/*: upgrade to 5.41.0 (e10e53a)
  • eslint: upgrade to 8.26.0 (187c843)
  • mongodb-memory-server: upgrade to 8.9.3 (1725f65)
  • mongoose: upgrade to 6.7.0 (d5fa0e0)
  • semver: upgrade to 7.3.8 (7dc8138)
  • typescript: upgrade to 4.8.4 (6590961), closes #644

9.12.1 (2022-09-26)

Fixes

  • add option to skip applying plugins on discriminators (f9cbc90)

9.12.0 (2022-09-13)

Dependencies

  • @types/jest: upgrade to 28.1.8 (cc0377f)
  • @types/lodash: upgrade to 4.14.185 (58bde50)
  • @types/semver: upgrade to 7.3.12 (570d6d2)
  • @typescript-eslint/*: upgrade to 5.37.0 (0eb4fa6)
  • eslint: upgrade to 8.23.1 (fe69e01)
  • jest-runner-tsd: upgrade to 3.1.1 (28dfd2a)
  • mongodb-memory-server: upgrade to 8.9.1 (76b8ba9)
  • mongoose: upgrade to 6.6.0 (44fce67)
  • ts-jest: upgrade to 28.0.8 (7bfba67)

9.11.2 (2022-08-25)

Style

9.11.1 (2022-08-25)

Fixes

  • scripts: use double quotes in lint file glob (#755) (e383d32)

9.11.0 (2022-07-28)

Dependencies

  • @types/jest: upgrade to 28.1.6 (3d93a26)
  • @typescript-eslint/*: upgrade to 5.31.0 (8a10681)
  • eslint: upgrade to 8.20.0 (eaf2af4)
  • jest: upgrade to 28.1.3 (436eda7)
  • lint-staged: upgrade to 12.5.0 (f447011)
  • mongodb-memory-server: upgrade to 8.8.0 (f7b95d5)
  • mongoose: upgrade to 6.5.0 (5535fa8)
  • ts-jest: upgrade to 28.0.7 (7dc67be)

9.11.0-beta.2 (2022-07-28)

Dependencies

  • lint-staged: upgrade to 12.5.0 (f447011)

9.11.0-beta.1 (2022-07-27)

Dependencies

  • @types/jest: upgrade to 28.1.6 (3d93a26)
  • @typescript-eslint/*: upgrade to 5.31.0 (8a10681)
  • eslint: upgrade to 8.20.0 (eaf2af4)
  • jest: upgrade to 28.1.3 (436eda7)
  • mongodb-memory-server: upgrade to 8.8.0 (f7b95d5)
  • mongoose: upgrade to 6.5.0 (5535fa8)
  • ts-jest: upgrade to 28.0.7 (7dc67be)

9.10.1 (2022-07-03)

Fixes

9.10.0 (2022-07-02)

Features

Dependencies

  • @types/jest: upgrade to 28.1.4 (feb2ece)
  • @types/node: upgrade to 12.20.55 (3e09201)
  • @types/semver: upgrade to 7.3.10 (92288de)
  • @typescript-eslint/*: upgrade to 5.30.3 (7a722e1)
  • eslint: upgrade to 8.19.0 (f5940b4)
  • eslint-plugin-prettier: upgrade to 4.2.1 (b1acd20)
  • jest: upgrade to 28.1.2 (e8139e2)
  • mongodb-memory-server: upgrade to 8.7.2 (c81fb51)
  • mongoose: upgrade to 6.4.2 (1558851)
  • prettier: upgrade to 2.7.1 (8a47e33)
  • ts-jest: upgrade to 28.0.5 (d663713)

Fixes

  • index: change "fields" to use mongoose's "IndexDefinition" type (38862e0)
  • typegoose: re-export type "SubDocumentType" and "ArraySubDocumentType" (16dadd5)
  • typegoose::getModelWithString: allow specifying QueryHelpers for return model (441113b)
  • types::BasePropOptions: update "enum" to use mongoose's types (8c8a6e2)
  • types::DocumentType: add correct generic for "toJSON" and "toObject" types (026482d), closes typegoose/typegoose#732
  • types::DocumentType: simplify conditional (be59b7a)
  • types::IIndexArray: remove generic (9983ce9)
  • types::IPluginsArray: remove generic (abff87e)
  • types::VirtualOptions: update "match" to use mongoose's types (dc6680f)

Style

  • typeguards:isRefType*: add tsdoc for "refType" parameter (c704bb6)
  • types: add "SubDocumentType" and "ArraySubDocumentType" to supplement DocumentType (72d49c1)
  • types::BeAnObject: update tsdoc to explain difference with "KeyStringAny" (3448fde)
  • types::EmptyVoidFn: fix typo in tsdoc (93aab06)
  • types::IndexOptions: add TODO for typegoose 10 (edcd0c4)
  • types::IObjectWithTypegooseName: deprecate interface and value (89810b8)
  • types::KeyStringAny: simplify type by using "Record" (77c9502)
  • types::ReturnModelType: update tsdoc (bb66145)
  • types::VirtualPopulateMap: change map type to not be coerced to "any" (b3c43ac)
  • utils::getClass: update tsdoc to reflect current implementation (51d2eba)

9.10.0-beta.10 (2022-07-02)

Style

  • types::IndexOptions: add TODO for typegoose 10 (edcd0c4)

9.10.0-beta.9 (2022-07-02)

Dependencies

  • @types/jest: upgrade to 28.1.4 (feb2ece)
  • @typescript-eslint/*: upgrade to 5.30.3 (7a722e1)
  • eslint: upgrade to 8.19.0 (f5940b4)
  • eslint-plugin-prettier: upgrade to 4.2.1 (b1acd20)
  • jest: upgrade to 28.1.2 (e8139e2)
  • mongodb-memory-server: upgrade to 8.7.2 (c81fb51)
  • mongoose: upgrade to 6.4.2 (1558851)

Fixes

  • types::BasePropOptions: update "enum" to use mongoose's types (8c8a6e2)
  • types::DocumentType: add correct generic for "toJSON" and "toObject" types (026482d), closes typegoose/typegoose#732
  • types::IIndexArray: remove generic (9983ce9)
  • types::IPluginsArray: remove generic (abff87e)
  • types::VirtualOptions: update "match" to use mongoose's types (dc6680f)

Style

  • types::BeAnObject: update tsdoc to explain difference with "KeyStringAny" (3448fde)
  • types::EmptyVoidFn: fix typo in tsdoc (93aab06)
  • types::IObjectWithTypegooseName: deprecate interface and value (89810b8)
  • types::KeyStringAny: simplify type by using "Record" (77c9502)
  • types::ReturnModelType: update tsdoc (bb66145)
  • types::VirtualPopulateMap: change map type to not be coerced to "any" (b3c43ac)

9.10.0-beta.8 (2022-06-30)

Fixes

  • types::DocumentType: simplify conditional (be59b7a)

9.10.0-beta.7 (2022-06-28)

Dependencies

  • @types/jest: upgrade to 28.1.3 (86c9b8e)
  • @typescript-eslint/*: upgrade to 5.30.0 (e87dffd)
  • eslint-plugin-prettier: upgrade to 4.1.0 (bde224a)
  • mongodb-memory-server: upgrade to 8.7.1 (2f382b6)

9.10.0-beta.6 (2022-06-26)

Fixes

  • index: change "fields" to use mongoose's "IndexDefinition" type (38862e0)

9.10.0-beta.5 (2022-06-24)

Fixes

  • typegoose::getModelWithString: allow specifying QueryHelpers for return model (441113b)

Style

  • typeguards:isRefType*: add tsdoc for "refType" parameter (c704bb6)
  • utils::getClass: update tsdoc to reflect current implementation (51d2eba)

9.10.0-beta.4 (2022-06-20)

Dependencies

  • @types/jest: upgrade to 28.1.2 (8fda636)
  • eslint: upgrade to 8.18.0 (4eb6b5a)
  • mongodb-memory-server: upgrade to 8.7.0 (7427db7)

9.10.0-beta.3 (2022-06-18)

Style

  • types: add "SubDocumentType" and "ArraySubDocumentType" to supplement DocumentType (72d49c1)

Fixes

  • typegoose: re-export type "SubDocumentType" and "ArraySubDocumentType" (16dadd5)

9.10.0-beta.2 (2022-06-17)

Dependencies

  • @types/node: upgrade to 12.20.55 (3e09201)
  • @types/semver: upgrade to 7.3.10 (92288de)
  • @typescript-eslint/*: upgrade to 5.28.0 (44f1388)
  • jest: upgrade to 28.1.1 (980ea20)
  • mongodb-memory-server: upgrade to 8.6.1 (a5335f0)
  • prettier: upgrade to 2.7.1 (8a47e33)
  • ts-jest: upgrade to 28.0.5 (d663713)

9.10.0-beta.1 (2022-06-05)

Features

Dependencies

  • @types/jest: upgrade to 28.1.1 (9521a04)
  • @types/node: upgrade to 12.20.54 (2bf4bdd)
  • eslint: upgrade to 8.17.0 (5dec6cc)
  • ts-jest: upgrade to 28.0.4 (aaf494b)

9.9.0 (2022-06-03)

Features

Refactor

  • typegoose::getModelForClass: assign options to new value instead of re-assigning (2e2f304)
  • typegoose::getModelForClass: rename value to be more intuitive (b504314)
  • utils::getName: rename a parameter to be more intuitive (cbdf759)

Dependencies

  • @types/jest: upgrade to 27.5.1 (ef199ce)
  • @types/lodash: upgrade to 4.14.182 (b1f5cb1)
  • @types/node: upgrade to 12.20.52 (72cb216)
  • @typescript-eslint/*: upgrade to 5.26.0 (5b25b23)
  • commitlint: upgrade to 16.3.0 (dd7301e)
  • eslint: upgrade to 8.16.0 (2be72ac)
  • jest: upgrade to 28.1.0 (661b10b)
  • mongodb-memory-server: upgrade to 8.6.0 (47bfcc4)
  • mongoose: upgrade to 6.3.5 (7f70529)
  • tslib: upgrade to 2.4.0 (8417ba1)

Style

  • constants: add tsdoc deprecate to backwards-compat Value (0791807)
  • errors::InvalidWhatIsItError: add tsdoc deprecate to backwards-compat error (eec2843)
  • globalOptions: update tsdoc (c10271b)
  • index: update tsdoc (3f3723a)
  • modelOptions: update tsdoc (a95d0aa)
  • plugin: update tsdoc (1753514)
  • prop: update tsdoc (619c7d7)
  • queryMethod: update tsdoc (c4e2632)
  • schema::_buildSchema: update tsdoc to current implementation (082de9f)
  • typegoose: add best-guess comment explaining why "rawOption" is used for "getName" (89c4b1b)
  • typegoose: fix missing and incorrect tsdoc (1cb946f)
  • typegoose: update tsdoc (07acb61)
  • typeguards: update tsdoc (1c05684)
  • types: update tsdoc (15488e6)
  • utils: update tsdoc to match current implementations (f2a10d0)
  • utils::getName: change tsdoc to be more descriptive (f10eb35)
  • utils::mergeMetadata: add "returns" tsdoc (109fb7d)

Fixes

  • types::BasePropOptions: replace "set" & "get" with upstream types (51296f4)
  • types::IndexOptions: remove options that has been fixed upstream (98c1918)
  • types::ValidateStringOptions: replace "match" with upstream types (f290fad)
  • types::VirtualOptions: replace options with upstream types (e2c721a)

9.9.0-beta.3 (2022-06-01)

Style

  • constants: add tsdoc deprecate to backwards-compat Value (0791807)
  • errors::InvalidWhatIsItError: add tsdoc deprecate to backwards-compat error (eec2843)
  • globalOptions: update tsdoc (c10271b)
  • index: update tsdoc (3f3723a)
  • modelOptions: update tsdoc (a95d0aa)
  • plugin: update tsdoc (1753514)
  • prop: update tsdoc (619c7d7)
  • queryMethod: update tsdoc (c4e2632)
  • typegoose: update tsdoc (07acb61)
  • typeguards: update tsdoc (1c05684)
  • types: update tsdoc (15488e6)
  • utils: update tsdoc to match current implementations (f2a10d0)

Fixes

  • types::BasePropOptions: replace "set" & "get" with upstream types (51296f4)
  • types::IndexOptions: remove options that has been fixed upstream (98c1918)
  • types::ValidateStringOptions: replace "match" with upstream types (f290fad)
  • types::VirtualOptions: replace options with upstream types (e2c721a)

9.9.0-beta.2 (2022-05-30)

Dependencies

  • mongoose: upgrade to 6.3.5 (7f70529)

9.9.0-beta.1 (2022-05-28)

Features

Style

  • schema::_buildSchema: update tsdoc to current implementation (082de9f)
  • typegoose: add best-guess comment explaining why "rawOption" is used for "getName" (89c4b1b)
  • typegoose: fix missing and incorrect tsdoc (1cb946f)
  • utils::getName: change tsdoc to be more descriptive (f10eb35)
  • utils::mergeMetadata: add "returns" tsdoc (109fb7d)

Refactor

  • typegoose::getModelForClass: assign options to new value instead of re-assigning (2e2f304)
  • typegoose::getModelForClass: rename value to be more intuitive (b504314)
  • utils::getName: rename a parameter to be more intuitive (cbdf759)

Dependencies

  • @types/jest: upgrade to 27.5.1 (ef199ce)
  • @types/lodash: upgrade to 4.14.182 (b1f5cb1)
  • @types/node: upgrade to 12.20.52 (72cb216)
  • @typescript-eslint/*: upgrade to 5.26.0 (5b25b23)
  • commitlint: upgrade to 16.3.0 (dd7301e)
  • eslint: upgrade to 8.16.0 (2be72ac)
  • jest: upgrade to 28.1.0 (661b10b)
  • mongodb-memory-server: upgrade to 8.6.0 (47bfcc4)
  • tslib: upgrade to 2.4.0 (8417ba1)

9.8.1 (2022-04-21)

The Type change in this release may break some array post hooks and need to be separated

Fixes

9.8.0 (2022-04-16)

Dependencies

  • @types/jest: upgrade to 27.4.1 (f1f1f7c)
  • @types/lodash: upgrade to 4.14.181 (02b1aee)
  • @typescript-eslint/*: upgrade to 5.19.0 (c86c5c8)
  • commitlint: upgrade to 16.2.3 (c486229)
  • eslint: upgrade to 8.13.0 (c6b8038)
  • eslint-config-prettier: upgrade to 8.5.0 (0f62917)
  • mongodb-memory-server: upgrade to 8.5.0 (7392b77)
  • mongoose: upgrade to 6.3.0 (2419824)
  • prettier: upgrade to 2.6.2 (f2adbc6)
  • semver: upgrade to 7.3.7 (367d797)
  • ts-jest: upgrade to 27.1.4 (4358ecc)

Fixes

9.7.1 (2022-03-23)

Style

  • utils::mapOptions: add proper interface for return type (3deb4ec)

Fixes

9.7.0 (2022-02-22)

Fixes

  • types::QueryHelperThis: fix missing QueryHelpers in DocumentType (03a39de)

Dependencies

  • @typescript-eslint/*: upgrade to 5.12.1 (a59ed73)
  • commitlint: upgrade to 16.2.1 (c3005bf)
  • eslint: upgrade to 8.9.0 (2cf59f0)
  • eslint-config-prettier: upgrade to 8.4.0 (9344989)
  • jest: upgrade to 27.5.1 (02670ca)
  • mongodb-memory-server: upgrade to 8.4.0 (ccea634)
  • mongoose: upgrade to 6.2.3 (6044db0)

9.6.2 (2022-02-07)

Fixes

  • dependencies: fix mongoose peer-dependency requirement (#669) (80eefcd)

9.6.1 (2022-02-07)

Fixes

9.6.0 (2022-02-05)

Features

Fixes

  • types: change type of "foreignField" from "DeferredFunc" to "DynamicStringFunc" (541aaf7)
  • utils::warnMixed: add debug log to show model-options on WARN (31942cd)

Dependencies

9.5.0 (2022-01-14)

Refactor

Fixes

Dependencies

  • @types/jest: upgrade to 27.4.0 (94516e9)
  • @types/node: upgrade to 12.20.39 and lock version (1175d35)
  • @typescript-eslint/*: upgrade to 5.9.1 (5c8cd82)
  • commitlint: upgrade to 16.0.2 (6060fc6)
  • eslint: upgrade to 8.6.0 (92c7aa2)
  • jest: upgrade to 27.4.7 (3a74b2a)
  • mongoose: upgrade to 6.1.6 (8a0404e)

9.4.0 (2021-12-22)

Features

  • errors: add custom Error "ExpectedTypeError" (506d145)
  • errors: add Error "OptionDoesNotSupportOptionError", merge E020 and E021 into E027 (04491ad)
  • errors: move Error E014 into custom Error "ResolveTypegooseNameError" (3ca1a67)
  • errors::NoValidClassError: add Error Code to Error and change message (32db334)
  • globalOptions: change to use custom Error "ExpectedTypeError" (c6540a5)
  • hooks::addToHooks: change to use "ExpectedTypeError" 1 (b8d630f)
  • hooks::addToHooks: change to use "ExpectedTypeError" 2 (4769658)
  • processProp: use custom Error "InvalidEnumTypeError" (83f131b)
  • schema: use custom Error "NoDiscriminatorFunctionError" (00de1cf)
  • schema: use custom Error "PathNotInSchemaError" (a897e0c)
  • typegoose::deleteModel: change to use custom Error "ExpectedTypeError" (90268b9)
  • typegoose::getModelWithString: change to use custom Error "ExpectedTypeError" (ebcab71)
  • typegoose:deleteModel: change to not error when not existing (fc30052)
  • utils::getName: throw Error when "cl" cannot be resolved to a constructor (7800289)
  • utils::mapOptions: use custom Error "InvalidOptionsConstructor" (8199f2f)

Style

  • add more Error REFACTOR and TODO comments (108301e)

Dependencies

  • @types/lodash: upgrade to 4.14.178 (ea8ff31)
  • @types/node: upgrade to 12.20.38 (35d9822)
  • @typescript-eslint/*: upgrade to 5.7.0 (0197ffe)
  • @typescript-eslint/*: upgrade to 5.8.0 (d7fcad1)
  • eslint: upgrade to 8.4.1 (aff4c54)
  • eslint: upgrade to 8.5.0 (93a8c07)
  • jest: upgrade to 27.4.5 (980f89c)
  • mongodb-memory-server: upgrade to 8.1.0 (24aac3d)
  • mongoose: upgrade to 6.1.3 (46076cd), closes typegoose/typegoose#647
  • ts-jest: upgrade to 27.1.1 (6f537b5)
  • ts-jest: upgrade to 27.1.2 (fc486a6)
  • typescript: lock to minor version (use "~" instead of "^") (e4e1565)

9.4.0-beta.3 (2021-12-22)

Dependencies

  • mongodb-memory-server: upgrade to 8.1.0 (24aac3d)
  • typescript: lock to minor version (use "~" instead of "^") (e4e1565)

9.4.0-beta.2 (2021-12-22)

Dependencies

9.4.0-beta.1 (2021-12-14)

Features

  • errors: add custom Error "ExpectedTypeError" (506d145)
  • errors: add Error "OptionDoesNotSupportOptionError", merge E020 and E021 into E027 (04491ad)
  • errors: move Error E014 into custom Error "ResolveTypegooseNameError" (3ca1a67)
  • errors::NoValidClassError: add Error Code to Error and change message (32db334)
  • globalOptions: change to use custom Error "ExpectedTypeError" (c6540a5)
  • hooks::addToHooks: change to use "ExpectedTypeError" 1 (b8d630f)
  • hooks::addToHooks: change to use "ExpectedTypeError" 2 (4769658)
  • processProp: use custom Error "InvalidEnumTypeError" (83f131b)
  • schema: use custom Error "NoDiscriminatorFunctionError" (00de1cf)
  • schema: use custom Error "PathNotInSchemaError" (a897e0c)
  • typegoose::deleteModel: change to use custom Error "ExpectedTypeError" (90268b9)
  • typegoose::getModelWithString: change to use custom Error "ExpectedTypeError" (ebcab71)
  • typegoose:deleteModel: change to not error when not existing (fc30052)
  • utils::getName: throw Error when "cl" cannot be resolved to a constructor (7800289)
  • utils::mapOptions: use custom Error "InvalidOptionsConstructor" (8199f2f)

Style

  • add more Error REFACTOR and TODO comments (108301e)

Dependencies

  • @types/lodash: upgrade to 4.14.178 (ea8ff31)
  • @typescript-eslint/*: upgrade to 5.7.0 (0197ffe)
  • eslint: upgrade to 8.4.1 (aff4c54)
  • jest: upgrade to 27.4.5 (980f89c)
  • ts-jest: upgrade to 27.1.1 (6f537b5)

9.3.1 (2021-12-06)

Fixes

9.3.0 (2021-12-06)

Features

Fixes

Dependencies

  • @types/jest: upgrade to 27.0.3 (3d7f4d9)
  • @types/lodash: upgrade to 4.14.177 (96b883f)
  • @types/node: upgrade to 12.20.37 (95a840f)
  • @types/semver: upgrade to 7.3.9 (7218046)
  • @typescript-eslint/*: upgrade to 5.5.0 (650d281)
  • class-transformer: upgrade to 0.5.1 (fc54396)
  • commitlint: upgrade to 15.0.0 (89f01bb)
  • eslint: upgrade to 8.4.0 (d8a7827)
  • husky: upgrade to 7.0.4 (f1f3827)
  • jest: upgrade to 27.4.3 (3f55c10)
  • lint-staged: upgrade to 11.2.6 (059325b)
  • loglevel: upgrade to 1.8.0 (aa7bffd)
  • mongodb-memory-server: upgrade to 8.0.4 (cbbfa26)
  • mongoose: upgrade to 6.0.14 (737f2dd)
  • prettier: upgrade to 2.5.1 (dfdadf7)
  • ts-jest: upgrade to 27.1.0 (d5651bd)

Style

9.2.0 (2021-10-16)

Dependencies

9.1.1 (2021-10-16)

Fixes

9.1.0 (2021-10-05)

Fixes

  • processProp: remove warning for Passthrough being a array while being non-direct (23c9cb0)

Dependencies

  • @deepkit/*: upgrade to 1.0.1-alpha.58 (4117a6b)
  • @types/lodash: upgrade to 4.14.175 (30d17d5)
  • @typescript-eslint/*: upgrade to 4.33.0 (dcaaa9e)
  • commitlint: upgrade to 13.2.0 (edd3229)
  • jest: upgrade to 27.2.4 (17ba696)
  • lint-staged: upgrade to 11.2.0 (d196f2a)
  • mongodb-memory-server: upgrade to 7.4.3 (2cfcbff)
  • mongoose: upgrade to 6.0.9 (6a6a825)

9.0.2 (2021-10-02)

Style

  • utils::mapOptions: add some comments (c8c74bd)

9.0.1 (2021-09-23)

Fixes

  • package.json: fix "peerDependencies" mongoose version (1f0b8de)

9.0.0 (2021-09-22)

⚠ BREAKING CHANGES

  • Build order for Classes to Schemas is changed to bottom-up, which can affect some environments

Co-authored-by: hasezoey hasezoey@gmail.com

  • mongoose: Upgrade to Mongoose 6.0.0 (major version upgrade)

Features

  • errors: add error "E025", called "NotValidModelError" (cd88aab)
  • errors: add error "StringLengthExpectedError" as "E026", merge "E015" and "E022" into "E026" (92be716)
  • errors: create custom error for "E003", called "FunctionCalledMoreThanSupportedError" (a93651e)
  • errors: create custom error for "E005", called "RefOptionIsUndefinedError" (586c3f2)
  • errors: create custom error for "E021", called "OptionRefDoesNotSupportArraysError" (eabadae)
  • errors: rename "CannotBeSymbol" to "CannotBeSymbolError" to match style (454c23b)
  • processProp: merge Error "E008" into "E026" (3469a22)
  • processProp: remove Error E007 (928f51d), closes typegoose/typegoose#599
  • typegoose: add option to use "Passthrough" directly (no "type" property in between) (7379810)
  • utils::mergeMetadata: change custom error to use "StringLengthExpectedError" (9ad3013)
  • change build order to bottom-up (when extending classes) (#243) (79977ee)
  • merge errors "E023" into "E013" (c8ce9b8)

Fixes

  • globalOptions: export function "mapValueToSeverity" to be used in tests (6b77dd7)
  • escape some error message "class.key" (af9af27)
  • utils: comment out the "deprecate" function, because unsued currently (ccfbca0)
  • utils::getName: check if "cl" is null or undefined (6e795e1)
  • rename "Schema.Types.Embedded" to "Schema.Types.Subdocument" (bdbbc9c)

Dependencies

  • @semantic-release/git: upgrade to 9.0.1 (d2caa84)
  • @types/jest: upgrade to 27.0.2 (257ce66)
  • @types/lodash: upgrade to 4.14.173 (43496aa)
  • @typescript-eslint/*: upgrade to 4.30.0 (85eb727)
  • @typescript-eslint/*: upgrade to 4.31.1 (214f825)
  • @typescript-eslint/*: upgrade to 4.31.2 (b5e2bce)
  • eslint-plugin-prettier: upgrade to 4.0.0 (643f4e0)
  • husky: upgrade to 7.0.2 (1759907)
  • jest: upgrade to 27.1.0 (ea94f98)
  • jest: upgrade to 27.2.0 (b5572dd)
  • jest: upgrade to 27.2.1 (5f0c7fd)
  • mongodb-memory-server: upgrade to 7.4.0 (1b51547)
  • mongodb-memory-server: upgrade to 7.4.1 (41cee76)
  • mongoose: upgrade to 6.0.7 (4cb5b2f)
  • mongoose: upgrade to version 6.0.1 (bc6fa61)
  • prettier: upgrade to 2.4.1 (7c08b76)
  • semantic-release: upgrade to 17.4.7 (6e78e00)
  • tslib: upgrade to 2.3.1 (1b3d9f5)
  • typescript: upgrade to 4.4.2 (6420bfd)
  • typescript: upgrade to 4.4.3 (fed16aa)

Refactor

  • processProp: remove redundant code (5575b97)
  • processProp: remove unnecessary object creation & spreads (1c36776)
  • utils: remove removed options workaround (e9996fd)
  • utils::mapOptions: reduce "getName" calls for the same object (c68e415)

Style

  • processProp: add warning when using "Passthrough" on WhatIsIt.ARRAY (0366fb8)
  • processProp: remove "istanbul-ignore" on tested lines (967cb41)
  • typegoose: add comment for "for of Map" (a4200b8)
  • types: remove TODO's that probably never happen (e9926c0)
  • types: use mongoose's types because mongoose issue 10529 got resolved (176063f)
  • utils: remove "instanbul-ignore" (ac5184a)
  • utils: remove "instanbul-ignore" for tested path (f1d9dc9)
  • add more Error "REFACTOR" comments (12ccf9e)
  • utils::deprecate: update tsdoc to be better readable (9d49c43)
  • add REFACTOR comments for errors to be re-done (32aa7ad)
  • apply eslint rules to top level and website js files (c6aa5cc)
  • update documentation about "Passthrough" class for mongoose 6.0 (6a4393e)

9.0.0-beta.11 (2021-09-21)

Features

  • errors: add error "StringLengthExpectedError" as "E026", merge "E015" and "E022" into "E026" (92be716)
  • processProp: merge Error "E008" into "E026" (3469a22)
  • utils::mergeMetadata: change custom error to use "StringLengthExpectedError" (9ad3013)

Dependencies

  • @types/jest: upgrade to 27.0.2 (257ce66)
  • @typescript-eslint/*: upgrade to 4.31.2 (b5e2bce)
  • jest: upgrade to 27.2.1 (5f0c7fd)
  • mongodb-memory-server: upgrade to 7.4.1 (41cee76)
  • mongoose: upgrade to 6.0.7 (4cb5b2f)

Refactor

  • processProp: remove unnecessary object creation & spreads (1c36776)

Style

  • types: remove TODO's that probably never happen (e9926c0)
  • utils: remove "instanbul-ignore" for tested path (f1d9dc9)

9.0.0-beta.10 (2021-09-19)

Features

  • typegoose: add option to use "Passthrough" directly (no "type" property in between) (7379810)

Dependencies

  • @semantic-release/git: upgrade to 9.0.1 (d2caa84)
  • @types/lodash: upgrade to 4.14.173 (43496aa)
  • @typescript-eslint/*: upgrade to 4.31.1 (214f825)
  • jest: upgrade to 27.2.0 (b5572dd)
  • prettier: upgrade to 2.4.1 (7c08b76)
  • typescript: upgrade to 4.4.3 (fed16aa)

Fixes

  • globalOptions: export function "mapValueToSeverity" to be used in tests (6b77dd7)

Style

  • processProp: add warning when using "Passthrough" on WhatIsIt.ARRAY (0366fb8)
  • typegoose: add comment for "for of Map" (a4200b8)
  • utils: remove "instanbul-ignore" (ac5184a)

9.0.0-beta.9 (2021-09-18)

Refactor

  • utils: remove removed options workaround (e9996fd)

Style

  • processProp: remove "istanbul-ignore" on tested lines (967cb41)

9.0.0-beta.8 (2021-09-16)

Features

  • merge errors "E023" into "E013" (c8ce9b8)
  • errors: add error "E025", called "NotValidModelError" (cd88aab)
  • errors: create custom error for "E003", called "FunctionCalledMoreThanSupportedError" (a93651e)

Style

  • add more Error "REFACTOR" comments (12ccf9e)

Refactor

  • utils::mapOptions: reduce "getName" calls for the same object (c68e415)

Fixes

  • escape some error message "class.key" (af9af27)
  • utils::getName: check if "cl" is null or undefined (6e795e1)

9.0.0-beta.7 (2021-09-13)

Features

Refactor

  • processProp: remove redundant code (5575b97)

9.0.0-beta.6 (2021-09-12)

Features

  • errors: create custom error for "E005", called "RefOptionIsUndefinedError" (586c3f2)
  • errors: create custom error for "E021", called "OptionRefDoesNotSupportArraysError" (eabadae)
  • errors: rename "CannotBeSymbol" to "CannotBeSymbolError" to match style (454c23b)

Fixes

  • utils: comment out the "deprecate" function, because unsued currently (ccfbca0)

Style

  • utils::deprecate: update tsdoc to be better readable (9d49c43)
  • add REFACTOR comments for errors to be re-done (32aa7ad)

9.0.0-beta.5 (2021-09-11)

Features

Fixes

  • hooks::addToHooks: add warning when "args" is over supported length (c928d33)

Style

  • apply eslint rules to top level and website js files (7404c44)
  • types::IHooksArray: add testdoc to all properties (fa20dcc)

Dependencies

  • semantic-release: upgrade to 17.4.7 (0675c68)

9.0.0-beta.4 (2021-09-07)

Style

  • apply eslint rules to top level and website js files (c6aa5cc)

9.0.0-beta.3 (2021-09-02)

Dependencies

  • @typescript-eslint/*: upgrade to 4.30.0 (85eb727)
  • eslint-plugin-prettier: upgrade to 4.0.0 (643f4e0)
  • jest: upgrade to 27.1.0 (ea94f98)
  • mongodb-memory-server: upgrade to 7.4.0 (1b51547)
  • typescript: upgrade to 4.4.2 (6420bfd)

9.0.0-beta.2 (2021-08-26)

⚠ BREAKING CHANGES

  • Build order for Classes to Schemas is changed to bottom-up, which can affect some environments

Features

  • change build order to bottom-up (when extending classes) (#243) (79977ee)

9.0.0-beta.1 (2021-08-26)

⚠ BREAKING CHANGES

  • mongoose: Upgrade to Mongoose 6.0.0 (major version upgrade)

Fixes

  • rename "Schema.Types.Embedded" to "Schema.Types.Subdocument" (bdbbc9c)

Style

  • types: use mongoose's types because mongoose issue 10529 got resolved (176063f)
  • update documentation about "Passthrough" class for mongoose 6.0 (6a4393e)

Dependencies

  • husky: upgrade to 7.0.2 (1759907)
  • mongoose: upgrade to version 6.0.1 (bc6fa61)
  • semantic-release: upgrade to 17.4.7 (6e78e00)
  • tslib: upgrade to 2.3.1 (1b3d9f5)

8.3.0 (2021-09-11)

Features

Fixes

  • hooks::addToHooks: add warning when "args" is over supported length (c928d33)

Style

  • apply eslint rules to top level and website js files (7404c44)
  • types::IHooksArray: add testdoc to all properties (fa20dcc)

Dependencies

  • semantic-release: upgrade to 17.4.7 (0675c68)

8.2.0 (2021-08-24)

Style

  • utils: change "SchemaTypeOpts" to "SchemaTypeOptions" (402fe7a)

Fixes

  • typegoose: buildSchema: fix return type (ce5bf45)
  • types: change "IndexOptions" to extend from "mongoose.IndexOptions" (968338e)
  • apply changes for "Schema.get" returning "string | undefined" instead of any (76b9799)

Dependencies

  • @types/jest: upgrade to version 27.0.1 (9b29aa7)
  • @types/lodash: upgrade to version 4.14.172 (316b56d)
  • @typescript-eslint/*: upgrade to version 4.29.3 (352c90a)
  • eslint-plugin-prettier: upgrade to version 3.4.1 (fc357fc)
  • lint-staged: upgrade to version 11.1.2 (82fca54)
  • mongodb-memory-server: upgrade to version 7.3.6 (096e0b6)
  • mongoose: upgrade to version 5.13.8 (e2ae6f9)
  • semantic-release: upgrade to version 17.4.6 (297a9e7)
  • ts-jest: upgrade to version 27.0.5 (7bccb36)

8.1.1 (2021-08-05)

Fixes

  • processProp: support Maps with SubDocument-Arrays (94fb0b9)

8.1.0 (2021-08-01)

Features

  • add error "CannotBeSymbol" to replace custom error (f6754cb)
  • add error "InvalidWhatIsItError" to replace custom error (cc30146)
  • add error "SelfContainingClassError" to replace custom error (3a32dde)
  • rename error "NoValidClass" to "NoValidClassError" (2ec44af)
  • types: passthrough some mongoose option-types (50370d1), closes typegoose/typegoose#259

Style

  • processProp: change to "import type" from "../types" (94b8046)
  • types: fix comment / tsdoc for "IndexOptions" (75cbb27)

Fixes

  • errors: change parameter for "NoValidClassError" from "any" to "unknown" (dbb95d8)

Dependencies

  • eslint: upgrade to version 7.32.0 (cd56ce6)

8.0.1 (2021-07-30)

Style

  • typegoose: add link to mongoose issue for "Passthrough" class (3fd6f4f)

8.0.0 (2021-07-28)

⚠ BREAKING CHANGES

  • typeguards: isRefType now is way more stricter and requires an second parameter to work
  • NodeJS 10 & 11 are now unsupported, lowest supported is now NodeJS 12
  • processProp: "ref" and "refPath" now use "mapArrayOptions" that means that some options might be mapped differently
  • Changing types from unofficial to official is an breaking change
  • prop: Removing deprecated options "items", "of", "refType"
  • prop: Removing deprecated function "mapProp"
  • prop: Removing deprecated function "arrayProp"

Features

Reverts

  • "chore(workflow): tests: change "semantic-release" to be an dry-run" (f0c0067)
  • "release: v7.6.0-beta.1" (8116a7d)

Fixes

  • defaultClasses: convert "Base" into an interface (2071aa7)
  • hooks: remove unused "done" callback (4692976), closes typegoose/typegoose#561
  • index: extend typings of the index decorator (#548) (f24ee9d)
  • processProp: add error code E023 for '"ref" is not supported for "${propKind}"!' (63a5b31)
  • processProp: set type to "Mixed" when type is still "*Map" (e98d026)
  • typegoose: fix lowest supported mongoose version (90d2c2f)
  • types: add "QueryHelpers" to "DocumentType" (f4dba22)
  • types: re-enable QueryHelpers for official types (99071b1)

Dependencies

  • @semantic-release/github: upgrade to version "7.2.3" (c52195c)
  • @semantic-release/npm: upgrade to "7.1.3" (a4fa9ce)
  • @semantic-release/npm: upgrade to version "7.1.3" (d58a074)
  • @semantic-release/release-notes-generator: upgrade to version "9.0.2" (c0b2a77)
  • @semantic-release/release-notes-generator: upgrade to version "9.0.3" (a8ba787)
  • @types/jest: upgrade to version "26.0.22" (e7d4ef1)
  • @types/jest: upgrade to version "26.0.23" (ab65cce)
  • @types/jest: upgrade to version 26.0.24 (d9b1b69)
  • @types/lodash: upgrade to version "4.14.170" (96be5b4)
  • @types/lodash: upgrade to version 4.14.171 (d6036de)
  • @types/node: upgrade to "10.17.56" (cc23392)
  • @types/node: upgrade to version "12.12.6" (0b91f99)
  • @types/semver: upgrade to version "7.3.6" (7e60b5c)
  • @types/semver: upgrade to version 7.3.8 (2f2d60e)
  • @typescript-eslint/*: upgrade to version "4.25.0" (e768711)
  • @typescript-eslint/*: upgrade to version "4.28.0" (7c8883b)
  • @typescript-eslint/*: upgrade to version "4.28.1" (49b1c11)
  • @typescript-eslint/*: upgrade to version 4.28.5 (d7dcc92)
  • commitlint: upgrade to "12.1.1" (6442141)
  • commitlint: upgrade to version "12.1.4" (7e29e40)
  • commitlint: upgrade to version 13.1.0 (62bbfb9)
  • coveralls: upgrade to version "3.1.1" (0a3211a)
  • eslint: upgrade to "7.26.0" (601814d)
  • eslint: upgrade to version "7.23.0" and plugins (bf18717)
  • eslint: upgrade to version "7.27.0" (0db5b74)
  • eslint: upgrade to version "7.29.0" (525f1c0)
  • eslint: upgrade to version 7.31.0 (e6ee83a)
  • husky: upgrade to version "6.0.0" (e20983b)
  • husky: upgrade to version "7.0.0" (5b58237)
  • husky: upgrade to version 7.0.1 (4decf83)
  • jest: upgrade to version "27.0.1" (351ace3)
  • jest: upgrade to version "27.0.5" (45e8e00)
  • jest: upgrade to version "27.0.6" (8eca711)
  • lint-staged: upgrade to version "11.0.0" (c8e6c13)
  • lint-staged: upgrade to version 11.1.1 (5f370ad)
  • mongodb-memory-server: upgrade to version "6.9.6" (fb28d1d)
  • mongodb-memory-server: upgrade to version 7.0.0 (6a5e914)
  • mongodb-memory-server: upgrade to version 7.3.4 (460bdcb)
  • mongoose: allow range "~5.12.14 || ~5.13.0" (bcba9a2)
  • mongoose: change from "^" to "~" until types are fixed (b651113)
  • mongoose: upgrade to version "5.11.18" (775f44e)
  • mongoose: upgrade to version "5.12.14" (943d581)
  • mongoose: upgrade to version "5.12.4" (c3b7ce1)
  • mongoose: upgrade to version "5.12.9" (3cc88ae)
  • mongoose: upgrade to version 5.13.3 (c7414e6)
  • prettier: upgrade to "2.3.0" (13058c1)
  • prettier: upgrade to version "2.3.2" (5e73507)
  • semantic-release: upgrade to version "17.4.2" (283afb1)
  • semantic-release: upgrade to version "17.4.3" (ed4cbfc)
  • semantic-release: upgrade to version "17.4.4" (090d05f)
  • ts-jest: upgrade eto version 27.0.4 (e20fd0c)
  • ts-jest: upgrade to version "26.5.4" (047051b)
  • ts-jest: upgrade to version "27.0.3" (dc0452f)
  • tslib: upgrade to version "2.2.0" (edd2581)
  • tslib: upgrade to version "2.3.0" (7a1ba2d)
  • typescript: upgrade to version "4.2.3" (26a17a3)
  • typescript: upgrade to version "4.3.2" (ee66bc6)
  • typescript: upgrade to version "4.3.4" (a2f4a5a)
  • typescript: upgrade to version "4.3.5" (4e87c03)
  • lockfile maintenance (3486ae3)
  • update yarn.lock (fc17dc5)

Style

  • eslintrc: disable rule "@typescript-eslint/no-non-null-assertion" (38a69d2)
  • hooks: disable rule "@typescript-eslint/no-unused-vars" for file (bf61ecb)
  • processProp: disable function "optionDeprecation" (90955ab)
  • schema: add comment on why an line is necessary (d38aa5a)
  • schema: remove "as any" cast (d9b2f24)
  • typegoose: remove non-null assertion (0413613)
  • types: fix lint (087091c)
  • types: fix TODO (issue closed) (20bd486)
  • types: remove unused comment (23d9e2a)
  • types::IndexOptions: simplify "weights" definition (294cfff)
  • utils: remove "as any" for "SchemaTypeOptions" & "OptionsConstructor" (7b5250a)
  • utils: remove unused parameters from "mergeWith" (06df924)
  • utils: update comments for mongoose 5.11.19 (74e1196)

8.0.0-beta.24 (2021-07-28)

Style

Fixes

  • defaultClasses: add missing 2nd parameter for findOrCreate() (#573) (8bd1254)
  • dependencies: lock "@types/mongoose" version to 5.10 minor in dev and peer dependencies (#574) (c7e49bb)

8.0.0-beta.23 (2021-07-28)

Dependencies

  • @types/jest: upgrade to version 26.0.24 (d9b1b69)
  • @types/lodash: upgrade to version 4.14.171 (d6036de)
  • @types/semver: upgrade to version 7.3.8 (2f2d60e)
  • @typescript-eslint/*: upgrade to version 4.28.5 (d7dcc92)
  • commitlint: upgrade to version 13.1.0 (62bbfb9)
  • eslint: upgrade to version 7.31.0 (e6ee83a)
  • husky: upgrade to version 7.0.1 (4decf83)
  • lint-staged: upgrade to version 11.1.1 (5f370ad)
  • mongodb-memory-server: upgrade to version 7.3.4 (460bdcb)
  • mongoose: upgrade to version 5.13.3 (c7414e6)
  • ts-jest: upgrade eto version 27.0.4 (e20fd0c)

Style

  • types: fix TODO (issue closed) (20bd486)

8.0.0-beta.22 (2021-07-21)

Features

8.0.0-beta.21 (2021-07-01)

Dependencies

  • husky: upgrade to version "7.0.0" (5b58237)
  • tslib: upgrade to version "2.3.0" (7a1ba2d)
  • typescript: upgrade to version "4.3.5" (4e87c03)

8.0.0-beta.20 (2021-07-01)

Dependencies

  • mongodb-memory-server: upgrade to version 7.0.0 (6a5e914)

8.0.0-beta.19 (2021-06-29)

Dependencies

  • mongoose: allow range "~5.12.14 || ~5.13.0" (bcba9a2)

8.0.0-beta.18 (2021-06-29)

Features

Dependencies

  • @typescript-eslint/*: upgrade to version "4.28.1" (49b1c11)
  • coveralls: upgrade to version "3.1.1" (0a3211a)
  • jest: upgrade to version "27.0.6" (8eca711)

8.0.0-beta.17 (2021-06-28)

⚠ BREAKING CHANGES

  • typeguards: isRefType now is way more stricter and requires an second parameter to work

Features

Dependencies

  • @typescript-eslint/*: upgrade to version "4.28.0" (7c8883b)
  • eslint: upgrade to version "7.29.0" (525f1c0)
  • jest: upgrade to version "27.0.5" (45e8e00)
  • prettier: upgrade to version "2.3.2" (5e73507)
  • ts-jest: upgrade to version "27.0.3" (dc0452f)
  • typescript: upgrade to version "4.3.4" (a2f4a5a)

8.0.0-beta.16 (2021-06-17)

Features

  • processProp: allow & correctly map reference-maps (581b6b3)

Fixes

  • processProp: set type to "Mixed" when type is still "*Map" (e98d026)

Dependencies

  • mongoose: upgrade to version "5.12.14" (943d581)

8.0.0-beta.15 (2021-06-17)

Fixes

Dependencies

  • @semantic-release/release-notes-generator: upgrade to version "9.0.3" (a8ba787)
  • semantic-release: upgrade to version "17.4.4" (090d05f)

8.0.0-beta.14 (2021-06-10)

Fixes

  • index: extend typings of the index decorator (#548) (f24ee9d)

Style

  • types::IndexOptions: simplify "weights" definition (294cfff)

8.0.0-beta.13 (2021-06-02)

Fixes

  • processProp: add error code E023 for '"ref" is not supported for "${propKind}"!' (8bdfcd7)

8.0.0-beta.12 (2021-05-31)

Fixes

  • processProp: add error code E023 for '"ref" is not supported for "${propKind}"!' (63a5b31)

8.0.0-beta.11 (2021-05-29)

⚠ BREAKING CHANGES

  • NodeJS 10 & 11 are now unsupported, lowest supported is now NodeJS 12

Features

  • unsupport nodejs 10 & 11 (d24d6d7)

Dependencies

  • @semantic-release/github: upgrade to version "7.2.3" (c52195c)
  • @semantic-release/npm: upgrade to version "7.1.3" (d58a074)
  • @types/jest: upgrade to version "26.0.23" (ab65cce)
  • @types/lodash: upgrade to version "4.14.170" (96be5b4)
  • @types/node: upgrade to version "12.12.6" (0b91f99)
  • @types/semver: upgrade to version "7.3.6" (7e60b5c)
  • @typescript-eslint/*: upgrade to version "4.25.0" (e768711)
  • commitlint: upgrade to version "12.1.4" (7e29e40)
  • eslint: upgrade to version "7.27.0" (0db5b74)
  • jest: upgrade to version "27.0.1" (351ace3)
  • lint-staged: upgrade to version "11.0.0" (c8e6c13)
  • semantic-release: upgrade to version "17.4.3" (ed4cbfc)
  • tslib: upgrade to version "2.2.0" (edd2581)
  • typescript: upgrade to version "4.3.2" (ee66bc6)

Style

  • eslintrc: disable rule "@typescript-eslint/no-non-null-assertion" (38a69d2)
  • hooks: disable rule "@typescript-eslint/no-unused-vars" for file (bf61ecb)
  • processProp: disable function "optionDeprecation" (90955ab)
  • typegoose: remove non-null assertion (0413613)
  • utils: remove unused parameters from "mergeWith" (06df924)

8.0.0-beta.10 (2021-05-29)

Fixes

  • typegoose: fix lowest supported mongoose version (90d2c2f)

8.0.0-beta.9 (2021-05-14)

Dependencies

  • mongoose: upgrade to version "5.12.9" (3cc88ae)

8.0.0-beta.8 (2021-05-14)

Features

  • utils: move E019 Error into its own class to confuse less (6ad5043)

8.0.0-beta.7 (2021-05-11)

Dependencies

  • @semantic-release/npm: upgrade to "7.1.3" (a4fa9ce)
  • commitlint: upgrade to "12.1.1" (6442141)
  • eslint: upgrade to "7.26.0" (601814d)
  • prettier: upgrade to "2.3.0" (13058c1)

8.0.0-beta.6 (2021-05-11)

Style

  • schema: add comment on why an line is necessary (d38aa5a)
  • schema: remove "as any" cast (d9b2f24)

8.0.0-beta.5 (2021-04-16)

Features

  • use customName and automaticName from buildSchema (#502) (9eab528)

Dependencies

  • mongoose: upgrade to version "5.12.4" (c3b7ce1)

Fixes

  • types: add "QueryHelpers" to "DocumentType" (f4dba22)

Style

  • hooks: update comment (9302e62)
  • index: update tsdoc (f418ffa)
  • modelOptions: update tsdoc (ae1f1da)
  • plugin: update tsdoc (b984dc1)
  • prop: update tsdoc (fff099b)
  • queryMethod: update tsdoc (e911c7b)
  • typegoose: update tsdoc (c277d93)
  • types: fix lint (087091c)
  • types: update tsdoc (0c91bb5)
  • utils: fix typos in comments (6e8d2d0)
  • utils: remove "as any" for "SchemaTypeOptions" & "OptionsConstructor" (7b5250a)

8.0.0-beta.4 (2021-03-31)

⚠ BREAKING CHANGES

  • processProp: "ref" and "refPath" now use "mapArrayOptions" that means that some options might be mapped differently

Features

8.0.0-beta.3 (2021-03-30)

Dependencies

  • lockfile maintenance (3486ae3)
  • @semantic-release/release-notes-generator: upgrade to version "9.0.2" (c0b2a77)
  • @types/jest: upgrade to version "26.0.22" (e7d4ef1)
  • @types/node: upgrade to "10.17.56" (cc23392)
  • eslint: upgrade to version "7.23.0" and plugins (bf18717)
  • husky: upgrade to version "6.0.0" (e20983b)
  • mongodb-memory-server: upgrade to version "6.9.6" (fb28d1d)
  • mongoose: change from "^" to "~" until types are fixed (b651113)
  • semantic-release: upgrade to version "17.4.2" (283afb1)
  • ts-jest: upgrade to version "26.5.4" (047051b)
  • typescript: upgrade to version "4.2.3" (26a17a3)

8.0.0-beta.2 (2021-03-06)

⚠ BREAKING CHANGES

  • Changing types from unofficial to official is an breaking change

Features

  • Update to work with mongoose 5.11 (6cdfb0f)

Dependencies

  • mongoose: upgrade to version "5.11.18" (775f44e)

Fixes

  • defaultClasses: convert "Base" into an interface (2071aa7)
  • types: re-enable QueryHelpers for official types (99071b1)

Style

  • types: remove unused comment (23d9e2a)
  • utils: update comments for mongoose 5.11.19 (74e1196)

8.0.0-beta.1 (2021-03-03)

⚠ BREAKING CHANGES

  • prop: Removing deprecated options "items", "of", "refType"
  • prop: Removing deprecated function "mapProp"
  • prop: Removing deprecated function "arrayProp"

Features

Reverts

  • "release: v7.6.0-beta.1" (8116a7d)

Dependencies

7.6.3 (2021-07-10)

Fixes

  • dependencies: lock "@types/mongoose" version to 5.10 minor in dev and peer dependencies (#574) (c7e49bb)

7.6.2 (2021-07-07)

Style

Fixes

  • defaultClasses: add missing 2nd parameter for findOrCreate() (#573) (8bd1254)

7.6.1 (2021-05-31)

Fixes

  • processProp: add error code E023 for '"ref" is not supported for "${propKind}"!' (8bdfcd7)

7.6.0 (2021-03-08)

Features

  • use customName and automaticName from buildSchema (#502) (9eab528)

Style

7.5.0 (2021-03-01)

Dependencies

  • class-transformer: upgrade to version "0.4.0" (ead6fea)
  • commitlint: upgrade to version "12.0.1" (6657a0a)
  • typescript: upgrade to version "4.2.2" (8b67ac3)
  • update dev dependencies (922a507)

Style

Fixes

  • typegoose: remove "non-null" assertion from "buildSchema" (9d0a10b)
  • utils: apply grammar change to error message (a0304e0)

Everything Below here is manually made:

7.4.8

  • Fix when using get/set option to use the schema instead of the class [typegoose#478]

7.4.7

  • Renamed type QueryMethod to AsQueryMethod to not conflict with the PascalCase export for decorator @queryMethod [typegoose#465]
  • Add aggregate hook [typegoose#471]

7.4.6

  • add param for existingMongoose/existingConnection to addModelToTypegoose [typegoose#436]
  • add mongoose version diagnostic info [typegoose#458]
  • update mongoose version error to currently supported range (from 5.9.x to 5.10.x)
  • add warning when using higher mongoose version than 5.10.18

7.4.5

  • Rename type NDA to NumberOrDocumentOrDocumentArray to be more understandable
  • Fix Argument of type 'string[]' is not assignable to parameter of type '"insertMany"'.ts(2769) [typegoose#362]

7.4.4

  • Apply correct processing with WhatIsIt when options "get/set" are provided [typegoose#422]

7.4.3

7.4.2

  • Default to mongoose.Schema.Types.Mixed if Type is still *Array [typegoose#300]

7.4.1

7.4.0

  • Update Dependencies
    • mongoose to 5.10.4
    • lodash to 4.17.20
    • loglevel to 1.7.0
    • tslib to 2.0.1
    • @types/mongoose to 5.7.36
  • Add warning if justOne is defined, but no Virtual Populate Options
  • Allow any argument to DeferredFunc
  • Add Type DynamicStringFunc
  • Allow definition of functions for localField & foreignField
  • Allow returning an function in ref (ref: () => (doc) => doc.someProp)
  • Allow the NestJS / Type-GraphQl way of defining arrays (type: () => [String] (and nested too))
  • [IC] Fix that dim is included as an option in the schema [typegoose#366]

7.3.5

  • Add Error Codes Errors & Warnings Details
  • Remove never triggered Error InvalidPropError
  • Change "Options-not-for-current-type" Errors into warnings (with actual information on what options are included) [typegoose#363]
  • [IC] Assigning schemaOptions in src/internal/schema.ts to a blank object [typegoose#357]

7.3.4

  • Improved Client-side check

7.3.3

  • Don't assume that the plugin function has an name [typegoose#353]
  • Only check mongoose & nodejs version if process is defined
  • [IC] replace all util.format with template strings [typegoose#348]
  • [IC] add wrapper & polyfill for util.deprecate[typegoose#344]

7.3.2

  • Update @prop tsdoc to show it supports Maps and Arrays
  • Update dead documentation links
  • Update enum-error to better reflect what the error is about

7.3.1

  • Update Dependencies
    • typescript to 3.9.7
  • Add hook-typings for countDocuments, estimatedDocumentCount, deleteMany, findOneAndDelete, deleteOne

7.3.0

  • Update Dependencies
    • mongoose to 5.9.22
    • lodash to 4.17.19
    • @types/mongoose to 5.7.30
    • @types/lodash to 4.14.157
    • @types/semver to 7.3.1
    • typescript to 3.9.6
  • TimeStamps's (Default Class) properties are not marked as Readonly anymore
  • All Typeguards now accept undefined as the first parameter too (if an type was OR with undefined, the function would give an type-error)
  • Add option discriminators for embedded Discriminators [typegoose#248]
  • Set correct Decorator Return type (ClassDecorator & PropertyDecorator)
  • Change warning message for warnMixed
  • If an SchemaType doesn't extend SchemaTypeOptions, the options are now defaulted to the outer-layer
  • innerOptions and outerOptions can now be used for Maps too
  • Custom Validators now support message being an function
  • Automatically convert mongoose.Types.Buffer to mongoose.Schema.Types.Buffer
  • Fix Types when extending default class Base with other than ObjectId [typegoose#316]
  • [IC] mapOptions now always errors if the given type doesn't extend mongoose.SchemaTypeOptions
  • [IC] Moved function _buildPropMetadata to its own file (processProp) and renamed it to processProp [typegoose#286]
  • [IC] Moved pre-processing in function prop into processProp [typegoose#286]
  • [IC] Removed error NoMetadataError
  • [IC] Removed check that Type needs to be defined in prop / processProp

7.2.0

  • Update Dependencies
    • mongoose to 5.9.17
    • @types/mongoose to 5.7.21
    • typescript to 3.9.3
  • Remove type RefSchemaType
  • Add mongoose.Schema.Types.* that are suitable for ref to RefType
  • Runtime-Deprecate @mapProp(TDEP0002) & @arrayProp(TDEP0001)
  • Runtime-Deprecate type-alias options, items & of & refType(TDEP0003)
  • Handle mongoose.Types.Array<Ref<>> for Typeguards (isDocumentArray & isRefTypeArray) [typegoose#278]

7.1.3

  • Added an Error if option ref is set but is undefined/null
  • Add mongoose.Types.DocumentArray and mongoose.Schema.Types.DocumentArray to @prop array-detection
  • Change if (!kind) to if (isNullOrUndefined(kind))

7.1.2

  • @prop options types now work again
  • BasePropOptions.type is now unknown instead of any
  • All aliases of BasePropOptions.type now inherit the types from there
  • Fix bug where autopopulate (or any other plugin) wouldn't pick up on virtuals [typegoose#274]
  • [IC] refType is now moved to prop

7.1.1

  • Remove empty interface PropOptions
  • Remove type PropOptionsWithValidate
  • Rename type PropOptionsWithNumberValidate to PropOptionsForNumber
  • Rename type PropOptionsWithStringValidate to PropOptionsForString
  • Add options options & match for VirtualOptions
  • Add option enum for ValidateNumberOptions
  • arrayProp & mapProp are now just an alias for prop
  • Set TSDoc option @deprecated for arrayProp and mapProp
  • Detect mongoose.Types.Array & mongoose.Schema.Types.Array as Array in @prop
  • Detect mongoose.Types.Map & mongoose.Schema.Types.Map as Map in @prop
  • Add Overloads to @prop
  • PascalCased decorators now have the TSDoc of the original function
  • Default class Base's __v & __t are now optional (with ?)
  • Fix mentioned bug from typegoose#181, to allow mongoose.Schema.Types.String & mongoose.Schema.Types.Number as valid enum types
  • Options of & items are now mapped to type and get called when buildSchema is called
  • [IC] DeDuplicate code in prop.ts

7.1.0

  • Update Dependencies
    • mongoose to 5.9.14
    • @types/mongoose to 5.7.19
    • tslib to 2.0.0
    • typescript to 3.9.2
  • Fix duplicate hooks / virtuals / queryMethods / plugins / indices via inheritance [typegoose#218]
  • improve TSDoc of some functions
  • Fix queryMethod reflection
  • Set proper function type for queryMethod
  • Added the ability to define option ref with an arrow-function (ref: () => type)
  • All Decorators are now exported PascalCased & camelCased
  • Actually export the @queryMethod decorator
  • The @queryMethod decorator now has correct types [typegoose#247]
  • The functions addModelToTypegoose, getModelForClass, buildSchema, deleteModelWithClass, getDiscriminatorModelForClass now have the T generic removed (it was unnecessary)
  • The functions addModelToTypegoose, getModelForClass, getDiscriminatorModelForClass now have an new optional generic QueryHelpers
  • The Type ReturnModelType now has the T generic removed (it was unnecessary)
  • The Type ReturnModelType now has an second optional generic QueryHelpers
  • Fix bug where ref: Class didn't execute getName when Virtual-Populate was used
  • Allow use of @prop for arrays & maps (In preparation for 8.0), it is now auto-detected based on design:type
  • The Decorator @plugin now automatically infers the options if the plugin & function have typings and use options
  • [IC] add some tslint rules & apply them
  • [IC] enable "strictNullChecks" & fix accordingly

7.0.0

To Migrate, please look at the migration guide

  • Update Dependencies
    • mongoose to 5.9.10
    • @types/mongoose to 5.7.12
  • Minimal NodeJS version is now 10.15
  • Minimal Typescript version is now 3.8.3
  • Typegoose class got completely removed
  • All Deprecated arrayProp options got remove
    • itemsRef replaced with plain ref
    • itemsRefPath replaced with plain refPath
    • itemsRefType replaced with plain refType
  • All enums got moved from src/types to src/internal/constants
  • All things from src/types now get exported as type
  • All Errors now get exported as errors
  • All non-essential types get exported as types
  • utils's getName function now gets exported
  • Add PropOption addNullToEnum
  • Remove Deprecated value overwrite for VirtualOptions
  • Remove instance properties from Model type (remove & T from ModelType)
  • Add class decorator queryMethod
  • [IC] rename file optionsProp to modelOptions
  • [IC] Replace mocha & chai with jest
  • [IC] Completely remove TG_USE_NEW_ENUM from documentation & code
  • [IC] Replace almost all if-throw with the internal assertion function
  • [IC] Move VirtualPopulate cache to Reflection
  • [IC] Move Plugins cache to Reflection
  • [IC] Move Hooks cache to Reflection
  • [IC] All remaining test's models now get exported with an name (not being exported as model anymore)

6.5.0

  • Update Dependencies
    • semver to 7.3.2
    • tslib to 1.11.1
    • loglevel to 1.6.8
  • Remove useNewEnum type from types
  • Add warning when value is an primitive and will result in an Mixed (fixes typegoose#152)
  • Add option language_override to IndexOptions
  • Fix spelling errors in documentation
  • [IC] Replace deprecated arrayProp options with proper ones in all tests & test-models

6.4.0

  • Update Dependencies
    • mongoose to 5.9.2
    • @types/mongoose to 5.7.1
    • semver to 7.1.3
    • loglevel to 1.6.7
    • tslib to 1.11.0
  • Completely remove __uniqueID, because it was not used internally anymore

6.3.2

  • Indexes: clone array instead of re-using it (fixes typegoose#194)

6.3.1

  • Hopefully fix the Strictmode error of the new Ref-Type

6.3.0

  • Update Dependencies
    • mongoose to 5.8.11
    • @types/mongoose to 5.7.0
    • semver to 7.1.2
  • Add @types/mongoose to peerDependencies
  • Add generic type to @plugin to set the type for the options
  • Use a modified Ref-Type to automatically get the type (if the Ref'd type has string as _id, it automatically sets the RefType to string)

6.2.2

  • Fix use of "rawOptions.type" after deletion (fixes typegoose#178)

6.2.1

  • Fix functions isString and isNumber to check against their mongoose.Schema.Types.*.name equivalent (fixes typegoose#149)

6.2.0

This Update may break some code (mongoose upgrade, inline _id change, enum changes)

  • Update Dependencies
    • Upgrade mongoose from 5.7.7 to 5.8.3
    • Upgrade @types/mongoose from 5.5.30 to 5.5.35
    • [IC] Upgrade Typescript from 3.7.2 to 3.7.4
    • [IC] Upgrade NYC from 14.1.1 to 15.0.0
  • The option useNewEnum (and TG_USE_NEW_ENUM) got removed, because it would interfere with the number-enums
  • Added the ability to use number-enums on number-type props
  • Changed behaviour of string-enums to only work on string-type props
  • Fix PropOptions type for autopopulate
  • [IC] When the type is a Schema, it is now handled by mapOptions & mapArrayOptions
  • [IC] fix tests not exiting after completion
  • [IC] add tslint-plugin tslint-consistent-codestyle

6.1.8

  • backport for:
    • fixes typegoose#160
    • [IC] mapArrayOptions now uses mapOptions
    • [IC] adding function mapOptions

6.1.7

  • add support for environment variables here the new documentation
  • [IC] warnMixed now uses the right target
  • [IC] add function utils.getRightTarget

6.1.6

  • handle _id: false/true better
  • add function getClass
  • [IC] fix using "name"-getter in getName

6.1.5

  • Option merging is now properly done
  • [IC] fix giving wrong key to customMerger
  • [IC] remove the need to use "cloneDeepWith"

6.1.4

  • Apply Global Options without needing @modelOptions
  • [IC] add function "utils.assignGlobalModelOptions"

6.1.3

  • fix bug when "buildSchema" didn't get called when overwriting the type in @prop
  • [IC] add tests for Generic Discriminators

6.1.2

  • Allow setting _id: false (and apply it) for @mapProp
  • [IC] De-duplicate code for _id if subDocument

6.1.1

  • deleteModel now deletes the model from the connection it is on typegoose#119
  • [IC] de-duplicate test code for connecting

6.1.0

  • Update Dependencies
    • Upgrade mongoose from 5.7.1 to 5.7.7
    • [IC] Upgrade Typescript from 3.6.x to 3.7.2
  • Completely remove @staticMethod & @instanceMethod, because they were completely obsolete
  • README now has no documentation anymore
  • @prop({ validate }) now accepts { validator, message } as an array
  • Add function deleteModel & deleteModelWithClass
  • allow Prop Option "type" to overwrite the inferred type look here for an example
  • integrate "Array Validators & Transform" tests typegoose#29
  • adding global options, with setGlobalOptions
  • add modelOption runSyncIndexes
  • add modelOption allowMixed
  • add text to PropOptions
  • deprecate ArrayPropOptions's itemsRef, itemsRefPath & itemsRefType
  • DocumentType will now overwrite the type of _id if the class is extending Base (in TypeScript there is currently no other way)
  • add tslib as dependency to minimize generated code
  • fixing typo in (deprecated) setModelForClass
  • Remake how Enums are handled, use setGlobalOptions({ globalOptions: { useNewEnum: true } }) (to not break existing databases made with the old handling)
  • add function getModelWithString
  • [IC] tsconfig: add option "strictBindCallApply"
  • [IC] tsconfig: add option "strictFunctionTypes"
  • [IC] combine initAsObject and initAsArray into initProperty
  • [IC] Use internal "isNullOrUndefined", needed because all "util.is*" functions got deprecated in node 4.0.0
  • [IC] Replace all "isArray" with "Array.isArray", needed because all "util.is*" functions got deprecated in node 4.0.0
  • [IC] adding many sanity isNullOrUndefined checks
  • [IC] Re-done how the handling of Mixed is done
  • [IC] Re-done how IModelOptions are merged (thanks to lodash cloneDeepWith & mergeWith)
  • [IC] de-duplicate "ref" & "refPath" code
  • [IC] added test for "Custom Types"
  • [IC] typegoose now makes use of "importHelpers"(tsconfig) to save some space
  • [IC] Refactor how "isPrimitive" works, some types like Buffer & Decimal now work
  • [IC] Added more debug logs to prop.ts
  • [IC] Move Decorator Cache to the class itself
  • [IC] "baseProp" now uses one single arguments, with all the options
  • [IC] "createUniqueID" now returns a boolean instead of the "initname"

6.0.4

This Release didn't change anything on the code, it was mostly tests & github-page

  • Update Dependencies
    • Upgrade mongoose from 5.7.1 to 5.7.4
  • Added soft warning when using "ref" in an "arrayProp"
  • Added soft warning when using "refPath" in an "arrayProp"
  • Add missing ")" to a deprecation message
  • [IC] Fixed some Test's types
  • [IC] internal variable renames to better reflect what they are for

6.0.3

  • when using @plugin, options are now checked if they are an object, when not: make them an object
  • Added many debug logs for _buildSchema
  • Added Prop Option autopopulate, only has an effect if mongoose-autopopulate is used
  • Added default class FindOrCreate which has the types for mongoose-findorcreate

6.0.2

  • actually allow overwriting "_id" of "Base"
  • [IC] add npm version script

6.0.1

  • Add TSDoc for refType on PropOptions
  • refPath now uses the right type (new uses refType instead of itemsType)
  • Fix decorator options (rawOptions) mutating thanks to typegoose#60
  • Pre hook's function's next is now not marked as "optional" anymore, which caused next() to be EmptyVoidFn | undefined

6.0.0

To Migrate, please look at the migration guide

  • Project got moved to the new repo (typegoose/typegoose) and new package @typegoose/typegoose
  • rename InstanceType<T> to DocumentType<T> [szokodiakos#366]
  • adding a migration guide from ~5.9 to 6.0.0
  • adding missing "get" and "set" property options [szokodiakos#260]
  • adding @modelOptions and getModelForClass and setModelForClass will now override it
  • setModelForClass is now deprecated [typegoose#6, szokodiakos#186]
  • setting the Typegoose Class to abstract
  • deprecating the Typegoose Class because of making the functions outsourced [szokodiakos#356]
  • hook methods can now be arrays of methods [szokodiakos#313]
  • completely removed parallel from pre hook
  • refactored the types of hooks
  • adding support for any value in prop for plugins [szokodiakos#374]
  • schema.loadClass is now used instead of @instanceMethod and @staticMethod [szokodiakos#48, szokodiakos#346, szokodiakos#182]
  • method decorators are now deprecated
  • schema generation got refactored (/reconstructed) multiple times
  • adding count to VirtualOptions
  • Updated Dependencies (^mongoose@5.7.1)
  • adding discriminator support [typegoose#11]
  • adding default class for (schemaOptions) timestamps
  • adding more docs to README & as tsdoc
  • some changes that are probably forgot
  • szokodiakos#363 got reverted in favor of mongoose@5.6.9
  • fixes Custom Options not passed through to mongoose & plugins when using ref [szokodiakos#379]
  • Adding "immutable" prop option [szokodiakos#320]
  • adding Types to Ref (to allow not just ObjectID) [szokodiakos#369]
  • szokodiakos#54 seems to work now in 6.0.0 (added test in 6.0.0-21)
  • because of the changes in 6.0.0 #235 got fixed
  • Adding "InvalidTypeError" for the case that "undefined" or "null" is used as a type (or something other happens)
  • Change Error text of "InvalidPropError"
  • adding some "soft-errors" and traces with "loglevel"
  • exposing settings for "loglevel"
  • fixes Decorator Execution Order [typegoose#23, typegoose#24]
  • add support for custom discriminator properties
  • add error if using a self-containing class
  • add support for using multiple classes with the same name (automaticName, customName, collection)
  • [IC] "NoParamConstructor" got renamed into "AnyParamConstructor" it now accepts any arguments
  • [IC] Remake data.ts to use Maps [typegoose#3]
  • [IC] adding many tests and bumping coverage
  • [IC] moving many Types to types.ts
  • [IC] removing unneeded dependencies
  • [IC] changed how travis runs jobs multiple times
  • [IC] many tslint rule changes
  • [IC] getting the name from "class.name" got outsourced into "utils.getName" (for future use)
  • [IC] use switches instead of many if's
  • [IC] adding some tests

5.9.2

  • Change README examples & badges to the new repo
  • use new travis.yml (from version 6.0.0)
  • use new style of package.json (from version 6.0.0)

  • Tags got deleted and added, please remove all local tags and re-download them

This Release did not change anything in the code, it is just there to update the NPM front

5.9.1

  • fix accidentally added typeguards
  • add a note that typegoose uses mongoose's strict by default
  • add note that typegoose doesn't work with classes with the same name (at least in 5.x, working on it in 6.x)
  • implemented a hack for ObjectId / ObjectID (mongoose some version fixed this)

5.9.0

  • This should not be a breaking release
  • Hooks now support Regular Expression for names, like mongoose
  • Tests are split into their own files
  • Fixing itemsRefPath & adding tests
  • itemsRef now supports to be used with a string as model
  • @prop({ alias }) is now supported
  • Index weights are now supported
  • isDocument & isDocumentArray typeguards are now implemented
  • Updated Dependencies Note worthy are:
    • mongoose 5.6 is now required instead of 5.5
    • this project should be used with TypeScript 3.5+
  • @mapProp() is now implemented
  • Fix for @prop({ select })
  • A public version of buildSchema is now available
  • Added more Documentation to README
  • Added TSDOC to many functions and properties
  • build target is now ES6 instead of ES5