Skip to content

Releases: lstkz/ts-mongoose

v0.0.20: Merge pull request #33 from BetterCallSky/refactor-optional

15 Oct 19:05
0be42e1
Compare
Choose a tag to compare

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 not Type | null | undefined
    • fix for array of subSchemas