ts-node --transpile-only or
tsc --transpile-only, otherwise sometimes types are missing completly or are the wrong type.
TypeScript provides the option to alias paths (with
tsconfig-paths), but is somehow incompatible with Typegoose, more info in here
It is currently not possible to use a self-containing class (sub-documents)
For References, this will work
Using babel as a TypeScript compiler is known to cause problems (like incorrect types)
We recommened you use
tsc directly, or
ts-jest for jest-testing
If Babel is still needed, then read Babel TypeScript preset and install the following plugins:
you will need to reproduce the
--emitDecoratorMetadata TypeScript compiler options by using the corresponding plugins for enabling decorators and emitting decorator metadata:
@prop cannot be applied to
set (ES6), because virtuals do not accept options & schema.loadClass wouldn't load these.
This option will NOT work, because there is no neat / simple way of defining such a thing in the same class.
Create multiple classes:
firstname.lastname@example.org and higher#@types/
@email@example.com, there are types for
.create, but they are not fully compatible with Typegoose's types. So if an error comes up that cannot be fixed, the workaround is to use