Releases: lstkz/ts-mongoose
Releases · lstkz/ts-mongoose
v0.0.20: Merge pull request #33 from BetterCallSky/refactor-optional
Changes since 0.0.19:
- Big change in API - removal of
optionalType()
, from now on schema properties are optional by default, required types needs declaration inside options object, just like in mongoose (for example:Type.string({ required: true })
) - Decimal128 support added
- Added
ExtractFromReq
which takes extracted props and convert them into simple types - that might be useful if you are using same interfaces on FE and BE and send data as JSON - Support for following schema options:
- timestamps, might be declared as simple boolean, boolean for each option or readonly string for each option
- versionKey - can be declared as boolean or readonly string
- fixes:
- statics - it's done in different way but should work correctly, take a look at readme
- optional fields are now represented as
Type | undefined
notType | null | undefined
- fix for array of subSchemas