Skip to content

Update dependency mongoose to ~4.13.0

Gitter Badger requested to merge renovate/mongoose-4.x into develop

This MR contains the following updates:

Package Type Update Change References
mongoose dependencies minor ~4.6.0 -> ~4.13.0 homepage, source

Release Notes

Automattic/mongoose

v4.13.19

Compare Source

====================

v4.13.18

Compare Source

====================

  • fix(model): handle setting populated path set via Document#populate() #​7302
  • fix(cast): backport fix from #​7290 to 4.x

v4.13.17

Compare Source

====================

  • fix(document): disallow setting constructor and prototype if strict mode false

v4.13.16

Compare Source

====================

  • fix(document): disallow setting proto if strict mode false
  • feat(error): backport adding modified paths to VersionError #​6928 freewil

v4.13.15

Compare Source

====================

  • fix(mongoose): add global usePushEach option for easier Mongoose 4.x + MongoDB 3.6 #​6858
  • chore: fix flakey tests for 4.x #​6853 Fonger
  • feat(error): add version number to VersionError #​6852 freewil

v4.13.14

Compare Source

====================

  • fix(model): handle retainKeyOrder option in findOneAndUpdate() #​6484

v4.13.13

Compare Source

====================

  • fix(update): stop clobbering $in when casting update #​6441 #​6339
  • fix: upgrade async -> 2.6.0 re: security warning

v4.13.12

Compare Source

====================

  • fix(document): make virtual get() return undefined instead of null if no getters #​6223
  • docs: fix url in useMongoClient error message #​6219 #​6217 lineus
  • fix(discriminator): don't copy discriminators property from base schema #​6122 #​6064

v4.13.11

Compare Source

====================

  • docs: fix links in 4.x docs #​6081
  • chore: add release script that uses --tag for npm publish for 4.x releases #​6063

v4.13.10

Compare Source

====================

  • docs(model+query): add lean() option to Model helpers #​5996 aguyinmontreal
  • fix: use lazy loading so we can build mongoose with webpack #​5993 #​5842
  • docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #​5984
  • fix(populate): handle populating embedded discriminator paths #​5970
  • docs(query+aggregate): add more detail re: maxTimeMS #​4066

v4.13.9

Compare Source

===================

v4.13.8

Compare Source

===================

  • docs(guide): use more up-to-date syntax for autoIndex example #​5933
  • docs: fix grammar #​5927 abagh0703
  • fix: propagate lean options to child schemas #​5914
  • fix(populate): use correct model with discriminators + nested populate #​5858

v4.13.7

Compare Source

===================

  • docs(schematypes): fix typo #​5889 gokaygurcan
  • fix(cursor): handle reject(null) with eachAsync callback #​5875 #​5874 ZacharyRSmith
  • fix: disallow setting mongoose.connection to invalid values #​5871 jinasonlin
  • docs(middleware): suggest using return next() to stop middleware execution #​5866
  • docs(connection): improve connection string query param docs #​5864
  • fix(document): run validate hooks on array subdocs even if not directly modified #​5861
  • fix(discriminator): don't treat $meta as defining projection when querying #​5859
  • fix(types): handle Decimal128 when using bson-ext on server side #​5850
  • fix(document): ensure projection with only $slice isn't treated as inclusive for discriminators #​4991
  • fix(model): throw error when passing non-object to create() #​2037

v4.13.6

Compare Source

===================

  • fix(schema): support strictBool option in schema #​5856 ekulabuhov
  • fix(update): make upsert option consistently handle truthy values, not just booleans, for updateOne() #​5839
  • refactor: remove unnecessary constructor check #​2057
  • docs(query): correct function signature for .mod() helper #​1806
  • fix(query): report ObjectParameterError when passing non-object as filter to find() and findOne() #​1698

v4.13.5

Compare Source

===================

  • fix(model): handle update cast errors correctly with bulkWrite #​5845 Michael77
  • docs: add link to bufferCommands option #​5844 ralphite
  • fix(model): allow virtual ref function to return arrays #​5834 brunohcastro
  • fix(query): don't throw uncaught error if query filter too big #​5812
  • fix(document): if setting unselected nested path, don't overwrite nested path #​5800
  • fix(document): support calling populate() on nested document props #​5703
  • fix: add strictBool option for schema type boolean #​5344 #​5211 #​4245
  • docs(faq): add faq re: typeKey #​1886
  • docs(query): add more detailed docs re: options #​1702

v4.13.4

Compare Source

===================

  • fix(aggregate): add chainable .option() helper for setting arbitrary options #​5829
  • fix(aggregate): add .pipeline() helper to get the current pipeline #​5825
  • docs: grammar fixes for unique FAQ #​5823 mfluehr
  • chore: add node 9 to travis #​5822 superheri
  • fix(model): fix infinite recursion with recursive embedded discriminators #​5821 Faibk

v4.13.3

Compare Source

===================

  • chore: add node 8 to travis #​5818 superheri
  • fix(document): don't apply transforms to nested docs when updating already saved doc #​5807

v4.13.2

Compare Source

===================

  • feat(buffer): add support for subtype prop #​5530

v4.13.1

Compare Source

====================

v4.13.0

Compare Source

===================

  • feat(aggregate): add $addFields helper #​5740 AyushG3112
  • feat(connection): add connection-level bufferCommands #​5720
  • feat(connection): add createCollection() helper #​5712
  • feat(populate): support setting localField and foreignField to functions #​5704 #​5602
  • feat(query): add multipleCastError option for aggregating cast errors when casting update #​5609
  • feat(populate): allow passing a function to virtual ref #​5602
  • feat(schema): add excludeIndexes option to optionally prevent collecting indexes from nested schemas #​5575
  • feat(model): report validation errors from insertMany() if using ordered: false and rawResult: true #​5337
  • feat(aggregate): add pre/post aggregate middleware #​5251
  • feat(schema): allow using set as a schema path #​1939

v4.12.6

Compare Source

===================

  • fix(schema): make clone() copy query helpers correctly #​5752
  • fix: undeprecate ensureIndex() and use it by default #​3280

v4.12.5

Compare Source

===================

  • fix(query): correctly handle $in and required for $pull and update validators #​5744
  • feat(aggegate): add $addFields pipeline operator #​5740 AyushG3112
  • fix(document): catch sync errors in document pre hooks and report as error #​5738
  • fix(populate): handle slice projections correctly when automatically selecting populated fields #​5737
  • fix(discriminator): fix hooks for embedded discriminators #​5706 wlingke
  • fix(model): throw sane error when customer calls mongoose.Model() over mongoose.model() #​2005

v4.12.4

Compare Source

===================

  • test(plugins): add coverage for idGetter with id as a schema property #​5713 wlingke
  • fix(model): avoid copying recursive $$context object when creating discriminator after querying #​5721
  • fix(connection): ensure connection promise helpers are removed before emitting 'connected' #​5714
  • docs(schema): add notes about runSettersOnQuery to schema setters #​5705
  • fix(collection): ensure queued operations run on the next tick #​5562

v4.12.3

Compare Source

===================

  • fix(connection): emit 'reconnect' event as well as 'reconnected' for consistency with driver #​5719
  • fix: correctly bubble up left/joined events for replica set #​5718
  • fix(connection): allow passing in autoIndex as top-level option rather than requiring config.autoIndex #​5711
  • docs(connection): improve docs regarding reconnectTries, autoReconnect, and bufferMaxEntries #​5711
  • fix(query): handle null with addToSet/push/pull/pullAll update validators #​5710
  • fix(model): handle setDefaultsOnInsert option for bulkWrite updateOne and updateMany #​5708
  • fix(query): avoid infinite recursion edge case when cloning a buffer #​5702

v4.12.2

Compare Source

===================

  • docs(faq): add FAQ about using arrow functions for getters/setters, virtuals, and methods #​5700
  • docs(schema): document the childSchemas property and add to public API #​5695
  • fix(query): don't project in populated field if parent field is already projected in #​5669
  • fix: bump mongodb -> 2.2.33 for issue with autoReconnect #​4513

v4.12.1

Compare Source

===================

  • fix(document): create new doc when setting single nested, no more set() on copy of priorVal #​5693
  • fix(model): recursively call applyMethods on child schemas for global plugins #​5690
  • docs: fix bad promise lib example on home page #​5686
  • fix(query): handle false when checking for inclusive/exclusive projection #​5685
  • fix(discriminator): allow reusing child schema #​5684
  • fix: make addToSet() on empty array with subdoc trigger manual population #​5504

v4.12.0

Compare Source

===================

  • docs(validation): add docs coverage for ValidatorError.reason #​5681
  • feat(discriminator): always add discriminatorKey to base schema to allow updating #​5613
  • fix(document): make nested docs no longer inherit parent doc's schema props #​5586 #​5546 #​5470
  • feat(query): run update validators on $pull and $pullAll #​5555
  • feat(query): add .error() helper to query to error out in pre hooks #​5520
  • feat(connection): add dropCollection() helper #​5393
  • feat(schema): add schema-level collation option #​5295
  • feat(types): add discriminator() function for single nested subdocs #​5244
  • feat(document): add $isDeleted() getter/setter for better support for soft deletes #​4428
  • feat(connection): bubble up reconnectFailed event when driver gives up reconnecting #​4027
  • fix(query): report error if passing array or other non-object as filter to update query #​3677
  • fix(collection): use createIndex() instead of deprecated ensureIndex() #​3280

v4.11.14

Compare Source

====================

  • chore: add nsp check to the CI build #​5679 hairyhenderson
  • fix: bump mquery because of security issue with debug package #​5677 #​5675 jonathanprl
  • fix(populate): automatically select() populated()-ed fields #​5669
  • fix(connection): make force close work as expected #​5664
  • fix(document): treat $elemMatch as inclusive projection #​5661
  • docs(model/query): clarify which functions fire which middleware #​5654
  • fix(model): make init() public and return a promise that resolves when indexes are done building #​5563

v4.11.13

Compare Source

====================

  • fix(query): correctly run replaceOne with update validators #​5665 sime1
  • fix(schema): replace mistype in setupTimestamp method #​5656 zipp3r
  • fix(query): avoid throwing cast error for strict: throw with nested id in query #​5640
  • fix(model): ensure class gets combined schema when using class syntax with discriminators #​5635
  • fix(document): handle setting doc array to array of top-level docs #​5632
  • fix(model): handle casting findOneAndUpdate() with overwrite and upsert #​5631
  • fix(update): correctly handle $ in updates #​5628
  • fix(types): handle manual population consistently for unshift() and splice() #​5504

v4.11.12

Compare Source

====================

  • docs(model): asterisk should not render as markdown bullet #​5644 timkinnane
  • docs: use useMongoClient in connection example #​5627 GabrielNicolasAvellaneda
  • fix(connection): call callback when initial connection failed #​5626
  • fix(query): apply select correctly if a given nested schema is used for 2 different paths #​5603
  • fix(document): add graceful fallback for setting a doc array value and pull()-ing a doc #​3511

v4.11.11

Compare Source

====================

  • fix(connection): properly set readyState in response to driver 'close' and 'reconnect' events #​5604
  • fix(document): ensure single embedded doc setters only get called once, with correct value #​5601
  • fix(timestamps): allow enabling updatedAt without createdAt #​5598
  • test: improve unique validator test by making create run before ensureIndex #​5595 #​5562
  • fix(query): ensure find callback only gets called once when post init hook throws error #​5592

v4.11.10

Compare Source

====================

  • docs: add KeenIO tracking #​5612
  • fix(schema): ensure validators declared with .validate() get copied with clone() #​5607
  • fix: remove unnecessary jest warning #​5480
  • fix(discriminator): prevent implicit discriminator schema id from clobbering base schema custom id #​5591
  • fix(schema): hide schema objectid warning for non-hex strings of length 24 #​5587
  • docs(populate): use story schema defined key author instead of creator #​5578 dmric
  • docs(document): describe usage of .set() #​5576
  • fix(document): ensure correct scope in single nested validators #​5569
  • fix(populate): don't mark path as populated until populate() is done #​5564
  • fix(document): make push()-ing a doc onto an empty array act as manual population #​5504
  • fix(connection): emit timeout event on socket timeout #​4513

v4.11.9

Compare Source

===================

  • fix(error): avoid using arguments.callee because that breaks strict mode #​5572
  • docs(schematypes): fix spacing #​5567
  • fix(query): enforce binary subtype always propagates to mongodb #​5551
  • fix(query): only skip castForQuery for mongoose arrays #​5536
  • fix(browser): rely on browser entrypoint to decide whether to use BrowserDocument or NodeDocument #​5480

v4.11.8

Compare Source

===================

  • feat: add warning about using schema ObjectId as type ObjectId #​5571 efkan
  • fix(schema): allow setting id property after schema was created #​5570 #​5548
  • docs(populate): remove confusing _ from populate docs #​5560
  • fix(connection): expose parsed uri fields (host, port, dbname) when using openUri() #​5556
  • docs: added type boolean to options documentation #​5547 ndabAP
  • test: add test coverage for stopping/starting server #​5524
  • fix(aggregate): pull read preference from schema by default #​5522

v4.11.7

Compare Source

===================

  • fix: correct properties when calling toJSON() on populated virtual #​5544 #​5442 davidwu226
  • docs: fix spelling #​5535 et
  • fix(error): always set name before stack #​5533
  • fix: add warning about running jest in jsdom environment #​5532 #​5513 #​4943
  • fix(document): ensure overwriting a doc array cleans out individual docs #​5523
  • fix(schema): handle creating arrays of single nested using type key #​5521
  • fix: upgrade mongodb -> 2.2.31 to support user/pass options #​5419

v4.11.6

Compare Source

===================

  • fix: limiting number of async operations per time in insertMany #​5529 andresattler
  • fix: upgrade mongodb -> 2.2.30 #​5517
  • fix(browserDocument): prevent stack overflow caused by double-wrapping embedded doc save() in jest #​5513
  • fix(document): clear single nested doc when setting to empty object #​5506
  • fix(connection): emit reconnected and disconnected events correctly with useMongoClient #​5498
  • fix(populate): ensure nested virtual populate gets set even if top-level property is null #​5431

v4.11.5

Compare Source

===================

  • docs: fix link to $lookup #​5516 TalhaAwan
  • fix: better parallelization for eachAsync #​5502 lchenay
  • docs(document): copy docs for save from model to doc #​5493
  • fix(document): handle dotted virtuals in toJSON output #​5473
  • fix(populate): restore user-provided limit after mutating so cursor() works with populate limit #​5468
  • fix(query): don't throw StrictModeError if geo query with upsert #​5467
  • fix(populate): propagate readPreference from query to populate queries by default #​5460
  • docs: warn not to use arrow functions for statics and methods #​5458
  • fix(query): iterate over all condition keys for setDefaultsOnInsert #​5455
  • docs(connection): clarify server/replset/mongos option deprecation with useMongoClient #​5442

v4.11.4

Compare Source

===================

  • fix: handle next() errors in eachAsync() #​5486 lchenay
  • fix(schema): propagate runSettersOnQuery option to implicitly created schemas #​5479 [https://github.com/ValYouW]
  • fix(query): run castConditions() correctly in update ops #​5477
  • fix(query): ensure castConditions called for findOne and findOneAnd* #​5477
  • docs: clarify relationship between $lookup and populate #​5475 TalhaAwan
  • test: add coverage for arrays of arrays zbjornson
  • fix(middleware): ensure that error handlers for save get doc as 2nd param #​5466
  • fix: handle strict: false correctly #​5454 #​5453 wookieb
  • fix(query): apply schema excluded paths if only projection is a $slice #​5450
  • fix(query): correct discriminator handling for schema select: false fields in schema #​5448
  • fix(cursor): call next() in series when parallel option used #​5446
  • chore: load bundled driver first to avoid packaging problem #​5443 prototypeme
  • fix(query): defer condition casting until final exec #​5434
  • fix(aggregate): don't rely on mongodb aggregate to put a cursor in the callback #​5394
  • docs(aggregate): add useMongooseAggCursor docs #​5394
  • docs(middleware): clarify context for document, query, and model middleware #​5381

v4.11.3

Compare Source

===================

  • fix(connection): remove .then() before resolving to prevent infinite recursion #​5471

v4.11.2

Compare Source

===================

  • docs: fix comment typo in connect example #​5435 ConnorMcF
  • fix(update): correctly cast document array in update validators with exec() #​5430
  • fix(connection): handle autoIndex with useMongoClient #​5423
  • fix(schema): handle type: [Array] in schemas #​5416
  • fix(timestamps): if overwrite is set and there's a $set, use $set instead of top-level update #​5413
  • fix(document): don't double-validate deeply nested doc array elements #​5411
  • fix(schematype): clone default objects so default not shared across object instances unless shared specified #​5407
  • fix(document): reset down the nested subdocs when resetting parent doc #​5406
  • fix: don't pass error arg twice to error handlers #​5405
  • fix(connection): make openUri() return connection decorated with then() and catch() #​5404
  • fix: enforce $set on an array must be an array #​5403
  • fix(document): don't crash if calling validateSync() after overwriting doc array index #​5389
  • fix(discriminator): ensure discriminator key doesn't count as user-selected field for projection #​4629

v4.11.1

Compare Source

====================

  • chore: add nsp check to the CI build #​5679 hairyhenderson
  • fix: bump mquery because of security issue with debug package #​5677 #​5675 jonathanprl
  • fix(populate): automatically select() populated()-ed fields #​5669
  • fix(connection): make force close work as expected #​5664
  • fix(document): treat $elemMatch as inclusive projection #​5661
  • docs(model/query): clarify which functions fire which middleware #​5654
  • fix(model): make init() public and return a promise that resolves when indexes are done building #​5563

v4.11.0

Compare Source

===================

  • feat(query): execute setters with query as context for runSettersOnQuery #​5339
  • feat(model): add translateAliases function #​5338 rocketspacer
  • feat(connection): add useMongoClient and openUri functions, deprecate current connect logic #​5304
  • refactor(schema): make id virtual not access doc internals #​5279
  • refactor: handle non-boolean lean #​5279
  • feat(cursor): add addCursorFlag() support to query and agg cursors #​4814
  • feat(cursor): add parallel option to eachAsync #​4244
  • feat(schema): allow setting custom error constructor for custom validators #​4009

v4.10.8

Compare Source

===================

  • docs: fix small formatting typo on schematypes #​5374 gianpaj
  • fix(model): allow null as an _id #​5370
  • fix(populate): don't throw async uncaught exception if model not found in populate #​5364
  • fix: correctly cast decimals in update #​5361
  • fix(error): don't use custom getter for ValidationError message #​5359
  • fix(query): handle runSettersOnQuery in built-in _id setter #​5351
  • fix(document): ensure consistent context for nested doc custom validators #​5347

v4.10.7

Compare Source

===================

  • docs(validation): show overriding custom validator error with 2nd cb arg #​5358
  • fix: parseOption mutates user passed option map #​5357 igwejk
  • docs: fix guide.jade typo #​5356 CalebAnderson2014
  • fix(populate): don't set populate virtual to ids when match fails #​5336
  • fix(query): callback with cast error if remove and delete* args have a cast error #​5323

v4.10.6

Compare Source

===================

  • fix(cursor): handle custom model option for populate #​5334
  • fix(populate): handle empty virtual populate with Model.populate #​5331
  • fix(model): make ensureIndexes() run with autoIndex: false unless called internally #​5328 #​5324 #​5317
  • fix: wait for all connections to close before resolving disconnect() promise #​5316
  • fix(document): handle setting populated path with custom typeKey in schema #​5313
  • fix(error): add toJSON helper to ValidationError so message shows up with JSON.stringify #​5309
  • feat: add getPromiseConstructor() to prevent need for mongoose.Promise.ES6 #​5305
  • fix(document): handle conditional required with undefined props #​5296
  • fix(model): clone options before inserting in save() #​5294
  • docs(populate): clarify that multiple populate() calls on same path overwrite #​5274

v4.10.5

Compare Source

===================

  • chore: improve contrib guide for building docs #​5312
  • fix(populate): handle init-ing nested virtuals properly #​5311
  • fix(update): report update validator error if required path under single nested doc not set
  • fix(schema): remove default validate pre hook that was causing issues with jest #​4943

v4.10.4

Compare Source

===================

v4.10.3

Compare Source

===================

  • docs: correct inconsistent references to updateOne and replaceOne #​5297 dhritzkiv
  • docs: fix dropdowns in docs #​5292 nathanallen
  • docs: add description of alias option #​5287
  • fix(document): prevent infinite loop if validating nested array #​5282
  • fix(schema): correctly handle ref ObjectIds from different mongoose libs #​5259
  • fix(schema): load child class methods after base class methods to allow override #​5227

v4.10.2

Compare Source

===================

  • fix: bump ms -> 2.0.0 and mquery -> 2.3.1 for minor security vulnerability #​5275

v4.10.1

Compare Source

===================

  • fix(aggregate): handle sorting by text score correctly #​5258
  • fix(populate): handle doc.populate() with virtuals #​5240
  • fix(schema): enforce that _id is never null #​5236

v4.10.0

Compare Source

===================

  • fix(schema): update clone method to include indexes #​5268 clozanosanchez
  • feat(schema): support aliases #​5184 rocketspacer
  • feat(aggregate): add mongoose-specific aggregation cursor option #​5145
  • refactor(model): make sharding into a plugin instead of core #​5105
  • fix(document): make nested doc mongoose internals not enumerable again #​5078
  • feat(model): pass params to pre hooks #​5064
  • feat(timestamps): support already defined timestamp paths in schema #​4868
  • feat(query): add runSettersOnQuery option #​4569
  • fix(query): add strictQuery option that throws when not querying on field not in schema #​4136
  • fix(update): more complete handling for overwrite option with update validators #​3556
  • feat: support unique: true in arrays via the mongoose-unique-array plugin #​3347
  • fix(model): always emit 'index', even if no indexes #​3347
  • fix(schema): set unique indexes on primitive arrays #​3347
  • feat(validation): include failed paths in error message and inspect output #​3064 #​2135
  • fix(model): return saved docs when create() fails #​2190

v4.9.10

Compare Source

===================

  • fix(connection): ensure callback arg to openSet() is handled properly #​5249
  • docs: remove dead plugins repo and add content links #​5247
  • fix(model): skip index build if connecting after model init and autoIndex false #​5176

v4.9.9

Compare Source

==================

  • docs: correct value for Query#regex() #​5230
  • fix(connection): don't throw if .catch() on open() promise #​5229
  • fix(schema): allow update with $currentDate for updatedAt to succeed #​5222
  • fix(model): versioning doesn't fail if version key undefined #​5221 basileos
  • fix(document): don't emit model error if callback specified for consistency with docs #​5216
  • fix(document): handle errors in subdoc pre validate #​5215

v4.9.8

Compare Source

==================

  • docs(subdocs): rewrite subdocs guide #​5217
  • fix(document): avoid circular JSON if error in doc array under single nested subdoc #​5208
  • fix(document): set intermediate empty objects for deeply nested undefined paths before path itself #​5206
  • fix(schema): throw error if first param to schema.plugin() is not a function #​5201
  • perf(document): major speedup in validating subdocs (50x in some cases) #​5191

v4.9.7

Compare Source

==================

  • docs: fix typo #​5204 phutchins
  • fix(schema): ensure correct path for deeply nested schema indexes #​5199
  • fix(schema): make remove a reserved name #​5197
  • fix(model): handle Decimal type in insertMany correctly #​5190
  • fix: upgrade kareem to handle async pre hooks correctly #​5188
  • docs: add details about unique not being a validator #​5179
  • fix(validation): handle returning a promise with isAsync: true #​5171

v4.9.6

Compare Source

==================

  • fix: update parentArray references when directly assigning document arrays #​5192 jhob
  • docs: improve schematype validator docs #​5178 milesbarr
  • fix(model): modify discriminator() class in place #​5175
  • fix(model): handle bulkWrite updateMany casting #​5172 tzellman
  • docs(model): fix replaceOne example for bulkWrite #​5168
  • fix(document): don't create a new array subdoc when creating schema array #​5162
  • fix(model): merge query hooks from discriminators #​5147
  • fix(document): add parent() function to subdocument to match array subdoc #​5134

v4.9.5

Compare Source

==================

  • fix(query): correct $pullAll casting of null #​5164 Sebmaster
  • docs: add advanced schemas docs for loadClass #​5157
  • fix(document): handle null/undefined gracefully in applyGetters() #​5143
  • fix(model): add resolveToObject option for mapReduce with ES6 promises #​4945

v4.9.4

Compare Source

==================

  • fix(schema): clone query middleware correctly #​5153 #​5141 clozanosanchez
  • docs(aggregate): fix typo #​5142
  • fix(query): cast .$ update to underlying array type #​5130
  • fix(populate): don't mutate populate result in place #​5128
  • fix(query): handle $setOnInsert consistent with $set #​5126
  • docs(query): add strict mode option for findOneAndUpdate #​5108

v4.9.3

Compare Source

==================

  • docs: document.js fixes for functions prepended with $ #​5131 krmannix
  • fix: Avoid exception on constructor check #​5129 monkbroc
  • docs(schematype): explain how to use isAsync with validate() #​5125
  • docs(schematype): explain custom message with required function #​5123
  • fix(populate): only apply refPath duplicate id optimization if not array #​5114
  • fix(document): copy non-objects to doc when init() #​5111
  • perf(populate): dont clone whole options every time #​5103
  • feat(document): add isDirectSelected() to minimize isSelected() changes #​5063
  • docs(schematypes): explain some subtleties with arrays #​5059

v4.9.2

Compare Source

==================

  • fix(discriminator): handle class names consistently #​5104
  • fix(schema): make clone() work with reusing discriminator schemas #​5098
  • fix(querycursor): run pre find hooks with .cursor() #​5096
  • fix(connection): throw error if username:password includes @​ or : #​5091
  • fix(timestamps): handle overwriting createdAt+updatedAt consistently #​5088
  • fix(document): ensure subdoc post save runs after parent save #​5085
  • docs(model): improve update docs #​5076 bertolo1988

v4.9.1

Compare Source

===================

  • fix(connection): ensure callback arg to openSet() is handled properly #​5249
  • docs: remove dead plugins repo and add content links #​5247
  • fix(model): skip index build if connecting after model init and autoIndex false #​5176

v4.9.0

Compare Source

==================

  • feat(document): return this from depopulate() #​5027
  • fix(drivers): stop emitting timeouts as errors #​5026
  • feat(schema): add a clone() function for schemas #​4983
  • feat(query): add rawResult option to replace passRawResult, deprecate passRawResult #​4977 #​4925
  • feat(schematype): support isAsync validator option and handle returning promises from validators, deprecate implicit async validators #​4290
  • feat(query): add replaceOne(), deleteOne(), deleteMany() #​3998
  • feat(model): add bulkWrite() #​3998

v4.8.7

Compare Source

==================

  • fix(model): if last arg in spread is falsy, treat it as a callback #​5061
  • fix(document): use $hook instead of hook to enable 'hook' as a path name #​5047
  • fix(populate): dont select foreign field if parent field is selected #​5037
  • fix(populate): handle passing no args to query.populate #​5036
  • fix(update): use correct method for casting nested arrays #​5032
  • fix(discriminator): handle array discriminators when casting $push #​5009

v4.8.6

Compare Source

==================

  • docs(document): remove text that implies that transform is false by default #​5023
  • fix(applyHooks): dont wrap a function if it is already wrapped #​5019
  • fix(document): ensure nested docs' toObject() clones #​5008

v4.8.5

Compare Source

==================

  • fix: check for empty schemaPath before accessing property $isMongooseDocumentArray #​5017 https://github.com/randyhoulahan
  • fix(discriminators): handle create() and push() for embedded discriminators #​5001
  • fix(querycursor): ensure close emitted after last data event #​4998
  • fix(discriminators): remove fields not selected in child when querying by base model #​4991

v4.8.4

Compare Source

==================

  • docs(discriminators): explain embedded discriminators #​4997
  • fix(query): fix TypeError when findOneAndUpdate errors #​4990
  • fix(update): handle nested single embedded in update validators correctly #​4989
  • fix(browser): make browser doc constructor not crash #​4987

v4.8.3

Compare Source

==================

  • chore: upgrade mongodb driver -> 2.2.24
  • docs(connections): addd some details about callbacks #​4986
  • fix: ensure class is created with new keyword #​4972 #​4947 benhjames
  • fix(discriminator): add applyPluginsToDiscriminators option #​4965
  • fix(update): properly cast array subdocs when casting update #​4960
  • fix(populate): ensure foreign field is selected for virtual populate #​4959
  • docs(query): document some query callback params #​4949
  • fix(document): ensure errors in validators get caught #​2185

v4.8.2

Compare Source

==================

  • fix(update): actually run validators on addToSet #​4953
  • fix(update): improve buffer error handling #​4944 ValYouW
  • fix(discriminator): handle subclassing with loadClass correctly #​4942
  • fix(query): allow passing Map to sort() #​4941
  • fix(document): handle setting discriminator doc #​4935
  • fix(schema): return correct value from pre init hook #​4928
  • fix(query): ensure consistent params in error handlers if pre hook errors #​4927

v4.8.1

Compare Source

==================

  • fix(query): handle $exists for arrays and embedded docs #​4937
  • fix(query): handle passing string to hint() #​4931

v4.8.0

Compare Source

==================

  • feat(schema): add saveErrorIfNotFound option and $where property #​4924 #​4004
  • feat(query): add $in implicitly if passed an array #​4912 QuotableWater7
  • feat(aggregate): helper for $facet #​4904 varunjayaraman
  • feat(query): add collation method #​4839
  • feat(schema): propogate strict option to implicit array subschemas #​4831 dkrosso
  • feat(aggregate): add helper for graphLookup #​4819 varunjayaraman
  • feat(types): support Decimal128 #​4759
  • feat(aggregate): add eachAsync() to aggregate cursor #​4300
  • feat(query): add updateOne and updateMany #​3997
  • feat(model): support options for insertMany #​3893
  • fix(document): run validation on single nested docs if not directly modified #​3884
  • feat(model): use discriminator constructor based on discriminatorKey in create() #​3624
  • feat: pass collection as context to debug function #​3261
  • feat(query): support push and addToSet for update validators #​2933
  • perf(document): refactor registerHooksFromSchema so hooks are defined on doc prototype #​2754
  • feat(types): add discriminator() function to doc arrays #​2723 #​1856
  • fix(populate): return an error if sorting underneath a doc array #​2202

v4.7.9

Compare Source

==================

  • fix(query): handle casting $exists under $not #​4933
  • chore: upgrade mongodb -> 2.2.22 re: #​4931

v4.7.8

Compare Source

==================

  • fix(populate): better handling for virtual populate under arrays #​4923
  • docs: upgrade contributors count #​4918 AdamZaczek
  • fix(query): don't set nested path default if setting parent path #​4911
  • docs(promise): add missing bracket #​4907
  • fix(connection): ensure error handling is consistently async #​4905
  • fix: handle authMechanism in query string #​4900
  • fix(document): ensure error handlers run for validate #​4885

v4.7.7

Compare Source

==================

  • fix(utils): don't crash if to[key] is null #​4881
  • fix: upgrade mongodb -> 2.2.21 #​4867
  • fix: add a toBSON to documents for easier querying #​4866
  • fix: suppress bluebird warning #​4854 davidwu226
  • fix(populate): handle nested virtuals in virtual populate #​4851

v4.7.6

Compare Source

==================

  • fix(model): allow passing non-array to insertMany #​4846
  • fix(populate): use base model name if no discriminator for backwards compat #​4843
  • fix: allow internal validate callback to be optional #​4842 arciisine
  • fix(document): don't skip pointCut if save not defined (like in browser doc) #​4841
  • chore: improve benchmarks #​4838 billouboq
  • perf: remove some unused parameters #​4837 billouboq
  • fix(query): don't call error handler if passRawResult is true and no error occurred #​4836

v4.7.5

Compare Source

==================

  • docs(model): fix spelling mistake #​4828 paulinoj
  • fix(aggregate): remove unhandled rejection when using aggregate.then() #​4824
  • perf: remove try/catch that kills optimizer #​4821
  • fix(model): handles populating with discriminators that may not have a ref #​4817
  • fix(document): handle setting array of discriminators #​3575

v4.7.4

Compare Source

==================

v4.7.3

Compare Source

==================

  • fix: upgrade mongodb driver -> 2.2.16 for several bug fixes and 3.4 support #​4799
  • fix(model): ensure discriminator key is correct for child schema on discriminator #​4790
  • fix(document): handle mark valid in subdocs correctly #​4778
  • fix(query): check for objects consistently #​4775

v4.7.2

Compare Source

==================

v4.7.1

Compare Source

==================

  • fix(schema): throw error if you use prototype as a schema path #​4746
  • fix(schema): throw helpful error if you define a virtual with the same path as a real path #​4744
  • fix(connection): make createConnection not throw rejected promises #​4742
  • fix(populate): allow specifiying options in model schema #​4741
  • fix(document): handle selected nested elements with defaults #​4739
  • fix(query): add model to cast error if possible #​4729
  • fix(query): handle timestamps with overwrite #​4054

v4.7.0

Compare Source

==================

  • docs: clean up schematypes #​4732 kidlj
  • perf: only get stack when necessary with VersionError #​4726 Sebmaster
  • fix(query): ensure correct casting when setting array element #​4724
  • fix(connection): ensure db name gets set when you pass 4 params #​4721
  • fix: prevent TypeError in node v7 #​4719 #​4706
  • feat(document): support .set() on virtual subpaths #​4716
  • feat(populate): support populate virtuals on nested schemas #​4715
  • feat(querycursor): support transform option and .map() #​4714 #​4705 cblanc
  • fix(document): dont set defaults on not-selected nested paths #​4707
  • fix(populate): don't throw if empty string passed to populate #​4702
  • feat(model): add loadClass() function for importing schema from ES6 class #​4668 rockmacaca

Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Merge request reports