All Versions
655
Latest Version
Avg Release Cycle
7 days
Latest Release
1126 days ago

Changelog History
Page 1

  • v5.13.7 Changes

    August 11, 2021
    • perf(index.d.ts): loosen up restrictions on ModelType generic for Schema for a ~50% perf improvement when compiling TypeScript and using intellisense #10536 #10515 #10349
    • fix(index.d.ts): fix broken Schema#index() types #10562 JaredReisinger
    • fix(index.d.ts): allow using SchemaTypeOptions with array of raw document interfaces #10537
    • fix(index.d.ts): define IndexOptions in terms of mongodb.IndexOptions #10563 JaredReisinger
    • fix(index.d.ts): improve intellisense for DocumentArray push() #10546
    • fix(index.d.ts): correct type for expires #10529
    • fix(index.d.ts): add Query#model property to ts bindings #10531
    • refactor(index.d.ts): make callbacks use the new Callback and CallbackWithoutResult types #10550 thiagokisaki
  • v5.13.6 Changes

    August 09, 2021
    • fix: upgrade mongodb driver -> 3.6.11 #10543 maon-fp
    • fix(schema): throw more helpful error when defining a document array using a schema from a different copy of the Mongoose module #10453
    • fix: add explicit check on constructor property to avoid throwing an error when checking objects with null prototypes #10512
    • fix(cursor): make sure to clear stack every 1000 docs when calling next() to avoid stack overflow with large batch size #10449
    • fix(index.d.ts): allow calling new Model(...) with generic Model param #10526
    • fix(index.d.ts): update type declarations of Schema.index method #10538 #10530 Raader
    • fix(index.d.ts): add useNewUrlParser and useUnifiedTopology to ConnectOptions #10500
    • fix(index.d.ts): add missing type for diffIndexes #10547 bvgusak
    • fix(index.d.ts): fixed incorrect type definition for Query's .map function #10544 GCastilho
    • docs(schema): add more info and examples to Schema#indexes() docs #10446
    • chore: add types property to package.json #10557 thiagokisaki
  • v5.13.5 Changes

    July 30, 2021
    • perf(index.d.ts): improve typescript type checking performance #10515 andreialecu
    • fix(index.d.ts): fix debug type in MongooseOptions #10510 thiagokisaki
    • docs(api): clarify that depopulate() with no args depopulates all #10501 gfrancz
  • v5.13.4 Changes

    July 28, 2021
    • fix: avoid pulling non-schema paths from documents into nested paths #10449
    • fix(update): support overwriting nested map paths #10485
    • fix(update): apply timestamps to subdocs that would be newly created by $setOnInsert #10460
    • fix(map): correctly clone subdocs when calling toObject() on a map #10486
    • fix(cursor): cap parallel batchSize for populate at 5000 #10449
    • fix(index.d.ts): improve autocomplete for new Model() by making doc an object with correct keys #10475
    • fix(index.d.ts): add MongooseOptions interface #10471 thiagokisaki
    • fix(index.d.ts): make LeanDocument work with PopulatedDoc #10494
    • docs(mongoose+connection): correct default value for bufferTimeoutMS #10476
    • chore: remove unnecessary 'eslint-disable' comments #10466 thiagokisaki
  • v5.13.3 Changes

    July 16, 2021
    • fix(model): avoid throwing error when bulkSave() called on a document with no changes #10437
    • fix(timestamps): apply timestamps when creating new subdocs with $addToSet and with positional operator #10447
    • fix(schema): allow calling Schema#loadClass() with class that has a static getter with no setter #10436
    • fix(model): handle re-applying object defaults after explicitly unsetting #10442 semirturgay
    • fix: bump mongodb driver -> 3.6.10 #10440 AbdelrahmanHafez
    • fix(index.d.ts): consistently use NativeDate instead of Date for Date validators and timestamps functions #10426
    • fix(index.d.ts): allow calling discriminator() with non-document #10452 #10421 DouglasGabr
    • fix(index.d.ts): allow passing ResultType generic to Schema#path() #10435
  • v5.13.2 Changes

    July 03, 2021
    • fix: hardcode @types/node version for now to avoid breaking changes from DefinitelyTyped/DefinitelyTyped#53669 #10415
    • fix(index.d.ts): allow using type: Date with Date paths in SchemaDefinitionType #10409
    • fix(index.d.ts): allow extra VirtualTypeOptions for better plugin support #10412
    • docs(api): add SchemaArray to docs #10397
    • docs(schema+validation): fix broken links #10396
    • docs(transactions): add note about creating a connection to transactions docs #10406
  • v5.13.1 Changes

    July 02, 2021
    • fix(discriminator): allow using array as discriminator key in schema and as tied value #10303
    • fix(index.d.ts): allow using & Document in schema definition for required subdocument arrays #10370
    • fix(index.d.ts): if using DocType that doesn't extends Document, default to returning that DocType from toObject() and toJSON() #10345
    • fix(index.d.ts): use raw DocType instead of LeanDocument when using lean() with queries if raw DocType doesn't extends Document #10345
    • fix(index.d.ts): remove err: any in callbacks, use err: CallbackError instead #10340
    • fix(index.d.ts): allow defining map of schemas in TypeScript #10389
    • fix(index.d.ts): correct return type for Model.createCollection() #10359
    • docs(promises+discriminators): correctly escape () in regexp to pull in examples correctly #10364
    • docs(update): fix outdated URL about unindexed upsert #10406 grimmer0125
    • docs(index.d.ts): proper placement of mongoose.Date JSDoc thiagokisaki
  • v5.13.0 Changes

    June 28, 2021
    • feat(query): add sanitizeProjection option to opt in to automatically sanitizing untrusted query projections #10243
    • feat(model): add bulkSave() function that saves multiple docs in 1 bulkWrite() #9727 #9673 AbdelrahmanHafez
    • feat(document): allow passing a list of virtuals or pathsToSkip to apply in toObject() and toJSON() #10120
    • fix(model): make Model.validate use object under validation as context by default #10360 AbdelrahmanHafez
    • feat(document): add support for pathsToSkip in validate and validateSync #10375 AbdelrahmanHafez
    • feat(model): add diffIndexes() function that calculates what indexes syncIndexes() will create/drop without actually executing any changes #10362 IslandRhythms
    • feat(document): avoid using sessions that have ended, so you can use documents that were loaded in the session after calling endSession() #10306
  • v5.12.15 Changes

    June 25, 2021
    • fix(index.d.ts): add extra TInstanceMethods generic param to Schema for cases when we can't infer from Model #10358
    • fix(index.d.ts): added typings for near() in model aggregation #10373 tbhaxor
    • fix(index.d.ts): correct function signature for Query#cast() #10388 lkho
    • docs(transactions): add import statement #10365 JimLynchCodes
    • docs(schema): add missing discriminatorKey schema option #10386 #10376 IslandRhythms
    • docs(index.d.ts): fix typo #10363 houssemchebeb
  • v5.12.14 Changes

    June 15, 2021
    • fix(schema): check that schema type is an object when setting isUnderneathDocArray #10361 vmo-khanus
    • fix(document): avoid infinite recursion when setting single nested subdoc to array #10351
    • fix(populate): allow populating nested path in schema using Model.populate() #10335
    • fix(drivers): emit operation-start/operation-end events to allow inspecting when operations start and end
    • fix(index.d.ts): improve typings for virtuals #10350 thiagokisaki
    • fix(index.d.ts): correct constructor type for Document #10328
    • fix(index.d.ts): add ValidationError as a possible type for ValidationError#errors #10320 IslandRhythms
    • fix: remove unnecessary async devDependency that's causing npm audit warnings #10281
    • docs(typescript): add schemas guide #10308
    • docs(model): add options parameter description to Model.exists() #10336 Aminoiz