Mongoose v5.11.6 Release Notes

Release Date: 2020-12-09 // 3 months ago
    • fix(middleware): ensure sync errors in pre hooks always bubble up to the calling code #9659
    • fix(index.d.ts): allow passing ObjectId properties as strings to create() and findOneAndReplace() #9676
    • fix(index.d.ts): allow calling mongoose.model() and Connection#model() with model as generic param #9685 #9678 sahasayan
    • fix(index.d.ts): Fix return type of Model#aggregate() #9680 orgads
    • fix(index.d.ts): optional next() parameter for post middleware #9683 isengartz
    • fix(index.d.ts): allow array of validators in SchemaTypeOptions #9686 cjroebuck

Previous changes from v5.11.5

    • fix(map): support null in maps of subdocs #9628
    • fix(index.d.ts): support object syntax for validate #9667
    • fix(index.d.ts): Allow number for Schema expires #9670 alecgibson
    • fix(index.d.ts): allow definining arbitrary properties on SchemaTypeOpts for plugins like mongoose-autopopulate #9669
    • fix(index.d.ts): add mongoose.models #9661 #9660 AbdelrahmanHafez
    • fix(index.d.ts): allow the next() argument to be optional #9665 #9664 sahasayan
    • fix(index.d.ts): add missing VirtualType#applyGetters() and applySetters(), Schema#virtuals, Schema#childSchemas, Query#_mongooseOptions #9658
    • fix(index.d.ts): add id to LeanDocuments in case it is defined in the user's schema #9657
    • fix(index.d.ts): add missing types for hook functions #9653
    • fix(index.d.ts): improve support for strict null checks with upsert and orFail() #9654
    • fix(index.d.ts): make return values for insertMany() more consistent #9662
    • fix(index.d.ts): Change options in Connection#collection() to be optional #9663 orgads
    • fix(index.d.ts): add the missing generic declaration for Schema #9655 sahasayan
    • fix(index.d.ts): add missing SchemaTypeOpts and ConnectionOptions aliases for backwards compat
    • docs(populate): remove sort() from limit example to avoid potential confusion #9584
    • docs(compatibility): add MongoDB server 4.4 version compatibility #9641