Migrate to 7.0.0
These are the changes made for 7.0.0 that are breaking or just important to know
Important, Read this first
This Guide is written for migration from version 6.5.0
to 7.0.0
, for versions >7.0.0 <8.0.0
, please consult the CHANGELOG
Requirements changed
- Nodejs 8 & 9 are now unsupported, lowest supported version is now
10.15
- Typescript
3.8
is now required (4.9
is recommended) - Mongoose
5.9.10
or higher is now required
Deprecation removals
arrayProp options removed
The following options got removed:
itemsRef
got replaced with justref
itemsRefPath
got replaced with justrefPath
itemsRefType
got replaced with justrefType
Typegoose class got removed
In 6.0.0 it was announced that the Typegoose
class was useless and will be removed in a future version. Now, in 7.0.0, it was completely removed.
[IC] all remaining cache-maps got moved to reflection
All possible cache-maps that were in data.ts
were refactored to be in the reflection of the class.
[IC] almost all "if-throw" blocks got replaced with "assertion" functions
Typescript 3.7 introduced a new type-keyword asserts
and now almost every occurrence has been replaced with a custom assertion function.
[IC] The Testing Framework for Typegoose changed to Jest
For Typegoose 7.0.0, the Testing Framework change from mocha + chai
to jest
*`IC` means `Internal Change`*