/node_modules/mongoose/History.md

https://bitbucket.org/coleman333/smartsite · Markdown · 4190 lines · 3568 code · 622 blank · 0 comment · 0 complexity · 095d0d73b30bce2f2fdc9559a60ce18c MD5 · raw file

Large files are truncated click here to view the full file

  1. 5.0.14 / 2018-04-09
  2. ===================
  3. * fix(schema): clone aliases and alternative option syntax correctly
  4. * fix(query): call utils.toObject in query.count like in query.find #6325 [lineus](https://github.com/lineus)
  5. * docs(populate): add middleware examples #6320 [BorntraegerMarc](https://github.com/BorntraegerMarc)
  6. * docs(compatibility): fix dead link #6319 [lacivert](https://github.com/lacivert)
  7. * docs(api): fix markdown parsing for parameters #6318 #6314 [lineus](https://github.com/lineus)
  8. * fix(populate): handle space-delimited paths in array populate #6296 #6284 [lineus](https://github.com/lineus)
  9. * fix(populate): support basic virtual populate underneath embedded discriminators #6273
  10. 5.0.13 / 2018-04-05
  11. ===================
  12. * docs(faq): add middleware to faq arrow function warning #6309 [lineus](https://github.com/lineus)
  13. * docs(schema): add example to loadClass() docs #6308
  14. * docs: clean up misc typos #6304 [sfrieson](https://github.com/sfrieson)
  15. * fix(document): apply virtuals when calling `toJSON()` on a nested path #6294
  16. * refactor(connection): use `client.db()` syntax rather than double-parsing the URI #6292 #6286
  17. * docs: document new behavior of required validator for arrays #6288 [daltones](https://github.com/daltones)
  18. * fix(schema): treat set() options as user-provided options #6274
  19. * fix(schema): clone discriminators correctly #6274
  20. * fix(update): make setDefaultsOnInsert not create subdoc if only default is id #6269
  21. * docs(discriminator): clarify 3rd argument to Model.discriminator() #2596
  22. 5.0.12 / 2018-03-27
  23. ===================
  24. * docs(query): updating model name in query API docs #6280 [lineus](https://github.com/lineus)
  25. * docs: fix typo in tests #6275 [styler](https://github.com/styler)
  26. * fix: add missing `.hint()` to aggregate #6272 #6251 [lineus](https://github.com/lineus)
  27. * docs(api): add headers to each API docs section for easer nav #6261
  28. * fix(query): ensure hooked query functions always run on next tick for chaining #6250
  29. * fix(populate): ensure populated array not set to null if it isn't set #6245
  30. * fix(connection): set readyState to disconnected if initial connection fails #6244 #6131
  31. * docs(model): make `create()` params show up correctly in docs #6242
  32. * fix(model): make error handlers work with MongoDB server errors and `insertMany()` #6228
  33. * fix(browser): ensure browser document builds defaults for embedded arrays correctly #6175
  34. * fix(timestamps): set timestamps when using `updateOne()` and `updateMany()` #6282 [gualopezb](https://github.com/gualopezb)
  35. 5.0.11 / 2018-03-19
  36. ===================
  37. * fix(update): handle $pull with $in in update validators #6240
  38. * fix(query): don't convert undefined to null when casting so driver `ignoreUndefined` option works #6236
  39. * docs(middleware): add example of using async/await with middleware #6235
  40. * fix(populate): apply justOne option before `completeMany()` so it works with lean() #6234
  41. * fix(query): ensure errors in user callbacks aren't caught in init #6195 #6178
  42. * docs(connections): document dbName option for Atlas connections #6179
  43. * fix(discriminator): make child schema nested paths overwrite parent schema paths #6076
  44. 4.13.12 / 2018-03-13
  45. ====================
  46. * fix(document): make virtual get() return undefined instead of null if no getters #6223
  47. * docs: fix url in useMongoClient error message #6219 #6217 [lineus](https://github.com/lineus)
  48. * fix(discriminator): don't copy `discriminators` property from base schema #6122 #6064
  49. 5.0.10 / 2018-03-12
  50. ===================
  51. * docs(schematype): add notes re: running setters on queries #6209
  52. * docs: fix typo #6208 [kamagatos](https://github.com/kamagatos)
  53. * fix(query): only call setters once on query filter props for findOneAndUpdate and findOneAndRemove #6203
  54. * docs: elaborate on connection string changes in migration guide #6193
  55. * fix(document): skip applyDefaults if subdoc is null #6187
  56. * docs: fix schematypes docs and link to them #6176
  57. * docs(faq): add FAQs re: array defaults and casting aggregation pipelines #6184 #6176 #6170 [lineus](https://github.com/lineus)
  58. * fix(document): ensure primitive defaults are set and built-in default functions run before setters #6155
  59. * fix(query): handle single embedded embedded discriminators in castForQuery #6027
  60. 5.0.9 / 2018-03-05
  61. ==================
  62. * perf: bump mongodb -> 3.0.4 to fix SSL perf issue #6065
  63. 5.0.8 / 2018-03-03
  64. ==================
  65. * docs: remove obsolete references to `emitIndexErrors` #6186 [isaackwan](https://github.com/isaackwan)
  66. * fix(query): don't cast findOne() until exec() so setters don't run twice #6157
  67. * fix: remove document_provider.web.js file #6186
  68. * fix(discriminator): support custom discriminator model names #6100 [wentout](https://github.com/wentout)
  69. * fix: support caching calls to `useDb()` #6036 [rocketspacer](https://github.com/rocketspacer)
  70. * fix(query): add omitUndefined option so setDefaultsOnInsert can kick in on undefined #6034
  71. * fix: upgrade mongodb -> 3.0.3 for reconnectTries: 0 blocking process exit fix #6028
  72. 5.0.7 / 2018-02-23
  73. ==================
  74. * fix: support eachAsync options with aggregation cursor #6169 #6168 [vichle](https://github.com/vichle)
  75. * docs: fix link to MongoDB compound indexes docs #6162 [br0p0p](https://github.com/br0p0p)
  76. * docs(aggregate): use eachAsync instead of incorrect `each()` #6160 [simllll](https://github.com/simllll)
  77. * chore: fix benchmarks #6158 [pradel](https://github.com/pradel)
  78. * docs: remove dead link to old blog post #6154 [markstos](https://github.com/markstos)
  79. * fix: don't convert dates to numbers when updating mixed path #6146 #6145 [s4rbagamble](https://github.com/s4rbagamble)
  80. * feat(aggregate): add replaceRoot, count, sortByCount helpers #6142 [jakesjews](https://github.com/jakesjews)
  81. * fix(document): add includedChildren flag to modifiedPaths() #6134
  82. * perf: don't create wrapper function if no hooks specified #6126
  83. * fix(schema): allow indexes on single nested subdocs for geoJSON #6113
  84. * fix(document): allow depopulating all fields #6073
  85. * feat(mongoose): add support for `useFindAndModify` option on singleton #5616
  86. 5.0.6 / 2018-02-15
  87. ==================
  88. * refactor(query.castUpdate): avoid creating error until necessary #6137
  89. * docs(api): fix missing api docs #6136 [lineus](https://github.com/lineus)
  90. * fix(schema): copy virtuals when using `clone()` #6133
  91. * fix(update): avoid digging into buffers with upsert and replaceOne #6124
  92. * fix(schema): support `enum` on arrays of strings #6102
  93. * fix(update): cast `$addToSet: [1, 2]` -> `$addToSet: { $each: [1, 2] }` #6086
  94. 5.0.5 / 2018-02-13
  95. ==================
  96. * docs: make > show up correctly in API docs #6114
  97. * fix(query): support `where()` overwriting primitive with object #6097
  98. * fix(schematype): don't run internal `resetId` setter on queries with _id #6093
  99. * fix(discriminator): don't copy `discriminators` property from base schema #6064
  100. * fix(utils): respect `valueOf()` when merging object for update #6059
  101. * docs(validation): fix typo 'maxLength' #4720
  102. * fix(document): apply defaults after setting initial value so default functions don't see empty doc #3781
  103. 5.0.4 / 2018-02-08
  104. ==================
  105. * docs: add lambda guide #6107
  106. * fix(connection): add `dbName` option to work around `mongodb+srv` not supporting db name in URI #6106
  107. * fix(schematype): fix regexp typo in ObjectId #6098 [JoshuaWise](https://github.com/JoshuaWise)
  108. * perf(document): re-use the modifiedPaths list #6092 [tarun1793](https://github.com/tarun1793)
  109. * fix: use console.info() instead of console.error() for debug output #6088 [yuristsepaniuk](https://github.com/yuristsepaniuk)
  110. * docs(validation): clean up runValidators and isAsync options docs for 5.x #6083
  111. * docs(model): use array instead of spread consistently for aggregate() #6070
  112. * fix(schema): make aliases handle mongoose-lean-virtuals #6069
  113. * docs(layout): add link to subdocs guide #6056
  114. * fix(query): make strictQuery: true strip out fields that aren't in the schema #6032
  115. * docs(guide): add notes for `strictQuery` option #6032
  116. 4.13.11 / 2018-02-07
  117. ====================
  118. * docs: fix links in 4.x docs #6081
  119. * chore: add release script that uses --tag for npm publish for 4.x releases #6063
  120. 5.0.3 / 2018-01-31
  121. ==================
  122. * fix: consistently use process.nextTick() to avoid sinon.useFakeTimers() causing ops to hang #6074
  123. * docs(aggregate): fix typo #6072 [adursun](https://github.com/adursun)
  124. * chore: add return type to `mongoose.model()` docs [bryant1410](https://github.com/bryant1410)
  125. * fix(document): depopulate push()-ed docs when saving #6048
  126. * fix: upgrade mongodb -> 3.0.2 #6019
  127. 5.0.2 / 2018-01-28
  128. ==================
  129. * fix(schema): do not overwrite default values in schema when nested timestamps are provided #6024 [cdeveas](https://github.com/cdeveas)
  130. * docs: fix syntax highlighting in models.jade, schematypes.jade, subdocs.jade #6058 [lineus](https://github.com/lineus)
  131. * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
  132. * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
  133. * fix(populate): handle populating embedded discriminator paths #5970
  134. 4.13.10 / 2018-01-28
  135. ====================
  136. * docs(model+query): add lean() option to Model helpers #5996 [aguyinmontreal](https://github.com/aguyinmontreal)
  137. * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
  138. * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
  139. * fix(populate): handle populating embedded discriminator paths #5970
  140. * docs(query+aggregate): add more detail re: maxTimeMS #4066
  141. 5.0.1 / 2018-01-19
  142. ==================
  143. * fix(document): make validate() not resolve to document #6014
  144. * fix(model): make save() not return DocumentNotFoundError if using fire-and-forget writes #6012
  145. * fix(aggregate): make options() work as advertised #6011 [spederiva](https://github.com/spederiva)
  146. * docs(queries): fix code samples #6008
  147. 5.0.0 / 2018-01-17
  148. ==================
  149. * test: refactor tests to use start fewer connections #5985 [fenanquin](https://github.com/fenanquin)
  150. * feat: add global bufferCommands option #5879
  151. * docs: new docs site and build system #5976
  152. * test: increase timeout on slow test cases #5968 [fenanquin](https://github.com/fenanquin)
  153. * fix: avoid casting out array filter elements #5965
  154. * feat: add Model.watch() wrapper #5964
  155. * chore: replace istanbul with nyc #5962 [ChristianMurphy](https://github.com/ChristianMurphy)
  156. 4.13.9 / 2018-01-07
  157. ===================
  158. * chore: update marked (dev dependency) re: security vulnerability #5951 [ChristianMurphy](https://github.com/ChristianMurphy)
  159. * fix: upgrade mongodb -> 2.2.34 for ipv6 and autoReconnect fixes #5794 #5760
  160. * docs: use useMongooseAggCursor for aggregate docs #2955
  161. 5.0.0-rc2 / 2018-01-04
  162. ======================
  163. * fix: add cleaner warning about no longer needing `useMongoClient` in 5.x #5961
  164. * chore: update acquit -> 0.5.1 for minor security patch #5961 [ChristianMurphy](https://github.com/ChristianMurphy)
  165. * docs: add docs for mongoose 4.x at http://mongoosejs.com/docs/4.x #5959
  166. * docs: add link to migration guide #5957
  167. * chore: update eslint to version 4.14.0 #5955 [ChristianMurphy](https://github.com/ChristianMurphy)
  168. * chore: update mocha to version 4.1.0 [ChristianMurphy](https://github.com/ChristianMurphy)
  169. 5.0.0-rc1 / 2018-01-02
  170. ======================
  171. * fix(index): use pluralize correctly for `mongoose.model()` #5958
  172. * fix: make mquery use native promises by default #5945
  173. * fix(connection): ensure 'joined' and 'left' events get bubbled up #5944
  174. 5.0.0-rc0 / 2017-12-28
  175. ======================
  176. * BREAKING CHANGE: always use mongoose aggregation cursor when using `.aggregate().cursor()` #5941
  177. * BREAKING CHANGE: attach query middleware when compiling model #5939
  178. * BREAKING CHANGE: `emitIndexErrors` is on by default, failing index build will throw uncaught error if not handled #5910
  179. * BREAKING CHANGE: remove precompiled browser bundle #5895
  180. * feat: add `mongoose.pluralize()` function #5877
  181. * BREAKING CHANGE: remove `passRawResult` option for `findOneAndUpdate`, use `rawResult` #5869
  182. * BREAKING CHANGE: implicit async validators (based on number of function args) are removed, return a promise instead #5824
  183. * BREAKING CHANGE: fail fast if user sets a unique index on `_id` #5820 [varunjayaraman](https://github.com/varunjayaraman)
  184. * BREAKING CHANGE: mapReduce resolves to an object with 2 keys rather than 2 separate args #5816
  185. * BREAKING CHANGE: `mongoose.connect()` returns a promise, removed MongooseThenable #5796
  186. * BREAKING CHANGE: query stream removed, use `cursor()` instead #5795
  187. * BREAKING CHANGE: use MongoDB driver 3.0.0, drop support for MongoDB server < 3.0.0 #5791 #4740
  188. * BREAKING CHANGE: remove support for `$pushAll`, remove `usePushEach` option #5670
  189. * BREAKING CHANGE: make date casting use native Date #5395 [varunjayaraman](https://github.com/varunjayaraman)
  190. * BREAKING CHANGE: remove `runSettersOnQuery`, always run setters on query #5340
  191. * BREAKING CHANGE: array of length 0 now satisfies `required: true` for arays #5139 [wlingke](https://github.com/wlingke)
  192. * BREAKING CHANGE: remove `saveErrorIfNotFound`, always error out if `save()` did not update a document #4973
  193. * BREAKING CHANGE: don't execute getters in reverse order #4835
  194. * BREAKING CHANGE: make boolean casting more strict #4245
  195. * BREAKING CHANGE: `toObject()` and `toJSON()` option parameter merges with defaults rather than overwriting #4131
  196. * feat: allow setting `default` on `_id` #4069
  197. * BREAKING CHANGE: `deleteX()` and `remove()` promise resolves to the write object result #4013
  198. * feat: support returning a promise from middleware functions #3779
  199. * BREAKING CHANGE: don't return a promise if callback specified #3670
  200. * BREAKING CHANGE: only cast `update()`, `updateX()`, `replaceOne()`, `remove()`, `deleteX()` in exec #3529
  201. * BREAKING CHANGE: sync errors in middleware functions are now handled #3483
  202. * BREAKING CHANGE: post hooks get flow control #3232
  203. * BREAKING CHANGE: deduplicate hooks when merging discriminator schema #2945
  204. * BREAKING CHANGE: use native promises by default, remove support for mpromise #2917
  205. * BREAKING CHANGE: remove `retainKeyOrder`, always use forward order when iterating through objects #2749
  206. * BREAKING CHANGE: `aggregate()` no longer accepts a spread #2716
  207. 4.13.8 / 2017-12-27
  208. ===================
  209. * docs(guide): use more up-to-date syntax for autoIndex example #5933
  210. * docs: fix grammar #5927 [abagh0703](https://github.com/abagh0703)
  211. * fix: propagate lean options to child schemas #5914
  212. * fix(populate): use correct model with discriminators + nested populate #5858
  213. 4.13.7 / 2017-12-11
  214. ===================
  215. * docs(schematypes): fix typo #5889 [gokaygurcan](https://github.com/gokaygurcan)
  216. * fix(cursor): handle `reject(null)` with eachAsync callback #5875 #5874 [ZacharyRSmith](https://github.com/ZacharyRSmith)
  217. * fix: disallow setting `mongoose.connection` to invalid values #5871 [jinasonlin](https://github.com/jinasonlin)
  218. * docs(middleware): suggest using `return next()` to stop middleware execution #5866
  219. * docs(connection): improve connection string query param docs #5864
  220. * fix(document): run validate hooks on array subdocs even if not directly modified #5861
  221. * fix(discriminator): don't treat $meta as defining projection when querying #5859
  222. * fix(types): handle Decimal128 when using bson-ext on server side #5850
  223. * fix(document): ensure projection with only $slice isn't treated as inclusive for discriminators #4991
  224. * fix(model): throw error when passing non-object to create() #2037
  225. 4.13.6 / 2017-12-02
  226. ===================
  227. * fix(schema): support strictBool option in schema #5856 [ekulabuhov](https://github.com/ekulabuhov)
  228. * fix(update): make upsert option consistently handle truthy values, not just booleans, for updateOne() #5839
  229. * refactor: remove unnecessary constructor check #2057
  230. * docs(query): correct function signature for .mod() helper #1806
  231. * fix(query): report ObjectParameterError when passing non-object as filter to find() and findOne() #1698
  232. 4.13.5 / 2017-11-24
  233. ===================
  234. * fix(model): handle update cast errors correctly with bulkWrite #5845 [Michael77](https://github.com/Michael77)
  235. * docs: add link to bufferCommands option #5844 [ralphite](https://github.com/ralphite)
  236. * fix(model): allow virtual ref function to return arrays #5834 [brunohcastro](https://github.com/brunohcastro)
  237. * fix(query): don't throw uncaught error if query filter too big #5812
  238. * fix(document): if setting unselected nested path, don't overwrite nested path #5800
  239. * fix(document): support calling `populate()` on nested document props #5703
  240. * fix: add `strictBool` option for schema type boolean #5344 #5211 #4245
  241. * docs(faq): add faq re: typeKey #1886
  242. * docs(query): add more detailed docs re: options #1702
  243. 4.13.4 / 2017-11-17
  244. ===================
  245. * fix(aggregate): add chainable .option() helper for setting arbitrary options #5829
  246. * fix(aggregate): add `.pipeline()` helper to get the current pipeline #5825
  247. * docs: grammar fixes for `unique` FAQ #5823 [mfluehr](https://github.com/mfluehr)
  248. * chore: add node 9 to travis #5822 [superheri](https://github.com/superheri)
  249. * fix(model): fix infinite recursion with recursive embedded discriminators #5821 [Faibk](https://github.com/Faibk)
  250. 4.13.3 / 2017-11-15
  251. ===================
  252. * chore: add node 8 to travis #5818 [superheri](https://github.com/superheri)
  253. * fix(document): don't apply transforms to nested docs when updating already saved doc #5807
  254. 4.13.2 / 2017-11-11
  255. ===================
  256. * feat(buffer): add support for subtype prop #5530
  257. 4.13.1 / 2017-11-08
  258. ===================
  259. * fix: accept multiple paths or array of paths to depopulate #5798 #5797 [adamreisnz](https://github.com/adamreisnz)
  260. * fix(document): pass default array as actual array rather than taking first element #5780
  261. * fix(model): increment version when $set-ing it in a save() that requires a version bump #5779
  262. * fix(query): don't explicitly project in discriminator key if user projected in parent path #5775 #5754
  263. * fix(model): cast query option to geoNear() #5765
  264. * fix(query): don't treat projection with just $slice as inclusive #5737
  265. * fix(discriminator): defer applying embedded discriminator hooks until top-level model is compiled #5706
  266. * docs(discriminator): add warning to always attach hooks before calling discriminator() #5706
  267. 4.13.0 / 2017-11-02
  268. ===================
  269. * feat(aggregate): add $addFields helper #5740 [AyushG3112](https://github.com/AyushG3112)
  270. * feat(connection): add connection-level bufferCommands #5720
  271. * feat(connection): add createCollection() helper #5712
  272. * feat(populate): support setting localField and foreignField to functions #5704 #5602
  273. * feat(query): add multipleCastError option for aggregating cast errors when casting update #5609
  274. * feat(populate): allow passing a function to virtual ref #5602
  275. * feat(schema): add excludeIndexes option to optionally prevent collecting indexes from nested schemas #5575
  276. * feat(model): report validation errors from `insertMany()` if using `ordered: false` and `rawResult: true` #5337
  277. * feat(aggregate): add pre/post aggregate middleware #5251
  278. * feat(schema): allow using `set` as a schema path #1939
  279. 4.12.6 / 2017-11-01
  280. ===================
  281. * fix(schema): make clone() copy query helpers correctly #5752
  282. * fix: undeprecate `ensureIndex()` and use it by default #3280
  283. 4.12.5 / 2017-10-29
  284. ===================
  285. * fix(query): correctly handle `$in` and required for $pull and update validators #5744
  286. * feat(aggegate): add $addFields pipeline operator #5740 [AyushG3112](https://github.com/AyushG3112)
  287. * fix(document): catch sync errors in document pre hooks and report as error #5738
  288. * fix(populate): handle slice projections correctly when automatically selecting populated fields #5737
  289. * fix(discriminator): fix hooks for embedded discriminators #5706 [wlingke](https://github.com/wlingke)
  290. * fix(model): throw sane error when customer calls `mongoose.Model()` over `mongoose.model()` #2005
  291. 4.12.4 / 2017-10-21
  292. ===================
  293. * test(plugins): add coverage for idGetter with id as a schema property #5713 [wlingke](https://github.com/wlingke)
  294. * fix(model): avoid copying recursive $$context object when creating discriminator after querying #5721
  295. * fix(connection): ensure connection promise helpers are removed before emitting 'connected' #5714
  296. * docs(schema): add notes about runSettersOnQuery to schema setters #5705
  297. * fix(collection): ensure queued operations run on the next tick #5562
  298. 4.12.3 / 2017-10-16
  299. ===================
  300. * fix(connection): emit 'reconnect' event as well as 'reconnected' for consistency with driver #5719
  301. * fix: correctly bubble up left/joined events for replica set #5718
  302. * fix(connection): allow passing in `autoIndex` as top-level option rather than requiring `config.autoIndex` #5711
  303. * docs(connection): improve docs regarding reconnectTries, autoReconnect, and bufferMaxEntries #5711
  304. * fix(query): handle null with addToSet/push/pull/pullAll update validators #5710
  305. * fix(model): handle setDefaultsOnInsert option for bulkWrite updateOne and updateMany #5708
  306. * fix(query): avoid infinite recursion edge case when cloning a buffer #5702
  307. 4.12.2 / 2017-10-14
  308. ===================
  309. * docs(faq): add FAQ about using arrow functions for getters/setters, virtuals, and methods #5700
  310. * docs(schema): document the childSchemas property and add to public API #5695
  311. * fix(query): don't project in populated field if parent field is already projected in #5669
  312. * fix: bump mongodb -> 2.2.33 for issue with autoReconnect #4513
  313. 4.12.1 / 2017-10-08
  314. ===================
  315. * fix(document): create new doc when setting single nested, no more set() on copy of priorVal #5693
  316. * fix(model): recursively call applyMethods on child schemas for global plugins #5690
  317. * docs: fix bad promise lib example on home page #5686
  318. * fix(query): handle false when checking for inclusive/exclusive projection #5685
  319. * fix(discriminator): allow reusing child schema #5684
  320. * fix: make addToSet() on empty array with subdoc trigger manual population #5504
  321. 4.12.0 / 2017-10-02
  322. ===================
  323. * docs(validation): add docs coverage for ValidatorError.reason #5681
  324. * feat(discriminator): always add discriminatorKey to base schema to allow updating #5613
  325. * fix(document): make nested docs no longer inherit parent doc's schema props #5586 #5546 #5470
  326. * feat(query): run update validators on $pull and $pullAll #5555
  327. * feat(query): add .error() helper to query to error out in pre hooks #5520
  328. * feat(connection): add dropCollection() helper #5393
  329. * feat(schema): add schema-level collation option #5295
  330. * feat(types): add `discriminator()` function for single nested subdocs #5244
  331. * feat(document): add $isDeleted() getter/setter for better support for soft deletes #4428
  332. * feat(connection): bubble up reconnectFailed event when driver gives up reconnecting #4027
  333. * fix(query): report error if passing array or other non-object as filter to update query #3677
  334. * fix(collection): use createIndex() instead of deprecated ensureIndex() #3280
  335. 4.11.14 / 2017-09-30
  336. ====================
  337. * chore: add nsp check to the CI build #5679 [hairyhenderson](https://github.com/hairyhenderson)
  338. * fix: bump mquery because of security issue with debug package #5677 #5675 [jonathanprl](https://github.com/jonathanprl)
  339. * fix(populate): automatically select() populated()-ed fields #5669
  340. * fix(connection): make force close work as expected #5664
  341. * fix(document): treat $elemMatch as inclusive projection #5661
  342. * docs(model/query): clarify which functions fire which middleware #5654
  343. * fix(model): make `init()` public and return a promise that resolves when indexes are done building #5563
  344. 4.11.13 / 2017-09-24
  345. ====================
  346. * fix(query): correctly run replaceOne with update validators #5665 [sime1](https://github.com/sime1)
  347. * fix(schema): replace mistype in setupTimestamp method #5656 [zipp3r](https://github.com/zipp3r)
  348. * fix(query): avoid throwing cast error for strict: throw with nested id in query #5640
  349. * fix(model): ensure class gets combined schema when using class syntax with discriminators #5635
  350. * fix(document): handle setting doc array to array of top-level docs #5632
  351. * fix(model): handle casting findOneAndUpdate() with overwrite and upsert #5631
  352. * fix(update): correctly handle $ in updates #5628
  353. * fix(types): handle manual population consistently for unshift() and splice() #5504
  354. 4.11.12 / 2017-09-18
  355. ====================
  356. * docs(model): asterisk should not render as markdown bullet #5644 [timkinnane](https://github.com/timkinnane)
  357. * docs: use useMongoClient in connection example #5627 [GabrielNicolasAvellaneda](https://github.com/GabrielNicolasAvellaneda)
  358. * fix(connection): call callback when initial connection failed #5626
  359. * fix(query): apply select correctly if a given nested schema is used for 2 different paths #5603
  360. * fix(document): add graceful fallback for setting a doc array value and `pull()`-ing a doc #3511
  361. 4.11.11 / 2017-09-10
  362. ====================
  363. * fix(connection): properly set readyState in response to driver 'close' and 'reconnect' events #5604
  364. * fix(document): ensure single embedded doc setters only get called once, with correct value #5601
  365. * fix(timestamps): allow enabling updatedAt without createdAt #5598
  366. * test: improve unique validator test by making create run before ensureIndex #5595 #5562
  367. * fix(query): ensure find callback only gets called once when post init hook throws error #5592
  368. 4.11.10 / 2017-09-03
  369. ====================
  370. * docs: add KeenIO tracking #5612
  371. * fix(schema): ensure validators declared with `.validate()` get copied with clone() #5607
  372. * fix: remove unnecessary jest warning #5480
  373. * fix(discriminator): prevent implicit discriminator schema id from clobbering base schema custom id #5591
  374. * fix(schema): hide schema objectid warning for non-hex strings of length 24 #5587
  375. * docs(populate): use story schema defined key author instead of creator #5578 [dmric](https://github.com/dmric)
  376. * docs(document): describe usage of `.set()` #5576
  377. * fix(document): ensure correct scope in single nested validators #5569
  378. * fix(populate): don't mark path as populated until populate() is done #5564
  379. * fix(document): make push()-ing a doc onto an empty array act as manual population #5504
  380. * fix(connection): emit timeout event on socket timeout #4513
  381. 4.11.9 / 2017-08-27
  382. ===================
  383. * fix(error): avoid using arguments.callee because that breaks strict mode #5572
  384. * docs(schematypes): fix spacing #5567
  385. * fix(query): enforce binary subtype always propagates to mongodb #5551
  386. * fix(query): only skip castForQuery for mongoose arrays #5536
  387. * fix(browser): rely on browser entrypoint to decide whether to use BrowserDocument or NodeDocument #5480
  388. 4.11.8 / 2017-08-23
  389. ===================
  390. * feat: add warning about using schema ObjectId as type ObjectId #5571 [efkan](https://github.com/efkan)
  391. * fix(schema): allow setting `id` property after schema was created #5570 #5548
  392. * docs(populate): remove confusing _ from populate docs #5560
  393. * fix(connection): expose parsed uri fields (host, port, dbname) when using openUri() #5556
  394. * docs: added type boolean to options documentation #5547 [ndabAP](https://github.com/ndabAP)
  395. * test: add test coverage for stopping/starting server #5524
  396. * fix(aggregate): pull read preference from schema by default #5522
  397. 4.11.7 / 2017-08-14
  398. ===================
  399. * fix: correct properties when calling toJSON() on populated virtual #5544 #5442 [davidwu226](https://github.com/davidwu226)
  400. * docs: fix spelling #5535 [et](https://github.com/et)
  401. * fix(error): always set name before stack #5533
  402. * fix: add warning about running jest in jsdom environment #5532 #5513 #4943
  403. * fix(document): ensure overwriting a doc array cleans out individual docs #5523
  404. * fix(schema): handle creating arrays of single nested using type key #5521
  405. * fix: upgrade mongodb -> 2.2.31 to support user/pass options #5419
  406. 4.11.6 / 2017-08-07
  407. ===================
  408. * fix: limiting number of async operations per time in insertMany #5529 [andresattler](https://github.com/andresattler)
  409. * fix: upgrade mongodb -> 2.2.30 #5517
  410. * fix(browserDocument): prevent stack overflow caused by double-wrapping embedded doc save() in jest #5513
  411. * fix(document): clear single nested doc when setting to empty object #5506
  412. * fix(connection): emit reconnected and disconnected events correctly with useMongoClient #5498
  413. * fix(populate): ensure nested virtual populate gets set even if top-level property is null #5431
  414. 4.11.5 / 2017-07-30
  415. ===================
  416. * docs: fix link to $lookup #5516 [TalhaAwan](https://github.com/TalhaAwan)
  417. * fix: better parallelization for eachAsync #5502 [lchenay](https://github.com/lchenay)
  418. * docs(document): copy docs for save from model to doc #5493
  419. * fix(document): handle dotted virtuals in toJSON output #5473
  420. * fix(populate): restore user-provided limit after mutating so cursor() works with populate limit #5468
  421. * fix(query): don't throw StrictModeError if geo query with upsert #5467
  422. * fix(populate): propagate readPreference from query to populate queries by default #5460
  423. * docs: warn not to use arrow functions for statics and methods #5458
  424. * fix(query): iterate over all condition keys for setDefaultsOnInsert #5455
  425. * docs(connection): clarify server/replset/mongos option deprecation with useMongoClient #5442
  426. 4.11.4 / 2017-07-23
  427. ===================
  428. * fix: handle next() errors in `eachAsync()` #5486 [lchenay](https://github.com/lchenay)
  429. * fix(schema): propagate runSettersOnQuery option to implicitly created schemas #5479 [https://github.com/ValYouW]
  430. * fix(query): run castConditions() correctly in update ops #5477
  431. * fix(query): ensure castConditions called for findOne and findOneAnd* #5477
  432. * docs: clarify relationship between $lookup and populate #5475 [TalhaAwan](https://github.com/TalhaAwan)
  433. * test: add coverage for arrays of arrays [zbjornson](https://github.com/zbjornson)
  434. * fix(middleware): ensure that error handlers for save get doc as 2nd param #5466
  435. * fix: handle strict: false correctly #5454 #5453 [wookieb](https://github.com/wookieb)
  436. * fix(query): apply schema excluded paths if only projection is a $slice #5450
  437. * fix(query): correct discriminator handling for schema `select: false` fields in schema #5448
  438. * fix(cursor): call next() in series when parallel option used #5446
  439. * chore: load bundled driver first to avoid packaging problem #5443 [prototypeme](https://github.com/prototypeme)
  440. * fix(query): defer condition casting until final exec #5434
  441. * fix(aggregate): don't rely on mongodb aggregate to put a cursor in the callback #5394
  442. * docs(aggregate): add useMongooseAggCursor docs #5394
  443. * docs(middleware): clarify context for document, query, and model middleware #5381
  444. 4.11.3 / 2017-07-14
  445. ===================
  446. * fix(connection): remove .then() before resolving to prevent infinite recursion #5471
  447. 4.11.2 / 2017-07-13
  448. ===================
  449. * docs: fix comment typo in connect example #5435 [ConnorMcF](https://github.com/ConnorMcF)
  450. * fix(update): correctly cast document array in update validators with exec() #5430
  451. * fix(connection): handle autoIndex with useMongoClient #5423
  452. * fix(schema): handle `type: [Array]` in schemas #5416
  453. * fix(timestamps): if overwrite is set and there's a $set, use $set instead of top-level update #5413
  454. * fix(document): don't double-validate deeply nested doc array elements #5411
  455. * fix(schematype): clone default objects so default not shared across object instances unless `shared` specified #5407
  456. * fix(document): reset down the nested subdocs when resetting parent doc #5406
  457. * fix: don't pass error arg twice to error handlers #5405
  458. * fix(connection): make openUri() return connection decorated with then() and catch() #5404
  459. * fix: enforce $set on an array must be an array #5403
  460. * fix(document): don't crash if calling `validateSync()` after overwriting doc array index #5389
  461. * fix(discriminator): ensure discriminator key doesn't count as user-selected field for projection #4629
  462. 4.11.1 / 2017-07-02
  463. ===================
  464. * docs: populate virtuals fix justOne description #5427 [fredericosilva](https://github.com/fredericosilva)
  465. * fix(connection): make sure to call onOpen in openUri() #5404
  466. * docs(query): justOne is actually single, and it default to false #5402 [zbjornson](https://github.com/zbjornson)
  467. * docs: fix small typo in lib/schema.js #5398 #5396 [pjo336](https://github.com/pjo336)
  468. * fix: emit remove on single nested subdocs when removing parent #5388
  469. * fix(update): handle update with defaults and overwrite but no update validators #5384
  470. * fix(populate): handle undefined refPath values in middle of array #5377
  471. * fix(document): ensure consistent setter context for single nested #5363
  472. * fix(query): support runSettersOnQuery as query option #5350
  473. 4.11.0 / 2017-06-25
  474. ===================
  475. * feat(query): execute setters with query as context for `runSettersOnQuery` #5339
  476. * feat(model): add translateAliases function #5338 [rocketspacer](https://github.com/rocketspacer)
  477. * feat(connection): add `useMongoClient` and `openUri` functions, deprecate current connect logic #5304
  478. * refactor(schema): make id virtual not access doc internals #5279
  479. * refactor: handle non-boolean lean #5279
  480. * feat(cursor): add addCursorFlag() support to query and agg cursors #4814
  481. * feat(cursor): add parallel option to eachAsync #4244
  482. * feat(schema): allow setting custom error constructor for custom validators #4009
  483. 4.10.8 / 2017-06-21
  484. ===================
  485. * docs: fix small formatting typo on schematypes #5374 [gianpaj](https://github.com/gianpaj)
  486. * fix(model): allow null as an _id #5370
  487. * fix(populate): don't throw async uncaught exception if model not found in populate #5364
  488. * fix: correctly cast decimals in update #5361
  489. * fix(error): don't use custom getter for ValidationError message #5359
  490. * fix(query): handle runSettersOnQuery in built-in _id setter #5351
  491. * fix(document): ensure consistent context for nested doc custom validators #5347
  492. 4.10.7 / 2017-06-18
  493. ===================
  494. * docs(validation): show overriding custom validator error with 2nd cb arg #5358
  495. * fix: `parseOption` mutates user passed option map #5357 [igwejk](https://github.com/igwejk)
  496. * docs: fix guide.jade typo #5356 [CalebAnderson2014](https://github.com/CalebAnderson2014)
  497. * fix(populate): don't set populate virtual to ids when match fails #5336
  498. * fix(query): callback with cast error if remove and delete* args have a cast error #5323
  499. 4.10.6 / 2017-06-12
  500. ===================
  501. * fix(cursor): handle custom model option for populate #5334
  502. * fix(populate): handle empty virtual populate with Model.populate #5331
  503. * fix(model): make ensureIndexes() run with autoIndex: false unless called internally #5328 #5324 #5317
  504. * fix: wait for all connections to close before resolving disconnect() promise #5316
  505. * fix(document): handle setting populated path with custom typeKey in schema #5313
  506. * fix(error): add toJSON helper to ValidationError so `message` shows up with JSON.stringify #5309
  507. * feat: add `getPromiseConstructor()` to prevent need for `mongoose.Promise.ES6` #5305
  508. * fix(document): handle conditional required with undefined props #5296
  509. * fix(model): clone options before inserting in save() #5294
  510. * docs(populate): clarify that multiple populate() calls on same path overwrite #5274
  511. 4.10.5 / 2017-06-06
  512. ===================
  513. * chore: improve contrib guide for building docs #5312
  514. * fix(populate): handle init-ing nested virtuals properly #5311
  515. * fix(update): report update validator error if required path under single nested doc not set
  516. * fix(schema): remove default validate pre hook that was causing issues with jest #4943
  517. 4.10.4 / 2017-05-29
  518. ===================
  519. * chore: dont store test data in same directory #5303
  520. * chore: add data dirs to npmignore #5301 [Starfox64](https://github.com/Starfox64)
  521. * docs(query): add docs about runSettersOnQuery #5300
  522. 4.10.3 / 2017-05-27
  523. ===================
  524. * docs: correct inconsistent references to updateOne and replaceOne #5297 [dhritzkiv](https://github.com/dhritzkiv)
  525. * docs: fix dropdowns in docs #5292 [nathanallen](https://github.com/nathanallen)
  526. * docs: add description of alias option #5287
  527. * fix(document): prevent infinite loop if validating nested array #5282
  528. * fix(schema): correctly handle ref ObjectIds from different mongoose libs #5259
  529. * fix(schema): load child class methods after base class methods to allow override #5227
  530. 4.10.2 / 2017-05-22
  531. ===================
  532. * fix: bump ms -> 2.0.0 and mquery -> 2.3.1 for minor security vulnerability #5275
  533. 4.10.1 / 2017-05-21
  534. ===================
  535. * fix(aggregate): handle sorting by text score correctly #5258
  536. * fix(populate): handle doc.populate() with virtuals #5240
  537. * fix(schema): enforce that `_id` is never null #5236
  538. 4.10.0 / 2017-05-18
  539. ===================
  540. * fix(schema): update clone method to include indexes #5268 [clozanosanchez](https://github.com/clozanosanchez)
  541. * feat(schema): support aliases #5184 [rocketspacer](https://github.com/rocketspacer)
  542. * feat(aggregate): add mongoose-specific aggregation cursor option #5145
  543. * refactor(model): make sharding into a plugin instead of core #5105
  544. * fix(document): make nested doc mongoose internals not enumerable again #5078
  545. * feat(model): pass params to pre hooks #5064
  546. * feat(timestamps): support already defined timestamp paths in schema #4868
  547. * feat(query): add runSettersOnQuery option #4569
  548. * fix(query): add strictQuery option that throws when not querying on field not in schema #4136
  549. * fix(update): more complete handling for overwrite option with update validators #3556
  550. * feat: support `unique: true` in arrays via the mongoose-unique-array plugin #3347
  551. * fix(model): always emit 'index', even if no indexes #3347
  552. * fix(schema): set unique indexes on primitive arrays #3347
  553. * feat(validation): include failed paths in error message and inspect output #3064 #2135
  554. * fix(model): return saved docs when create() fails #2190
  555. 4.9.10 / 2017-05-17
  556. ===================
  557. * fix(connection): ensure callback arg to openSet() is handled properly #5249
  558. * docs: remove dead plugins repo and add content links #5247
  559. * fix(model): skip index build if connecting after model init and autoIndex false #5176
  560. 4.9.9 / 2017-05-13
  561. ==================
  562. * docs: correct value for Query#regex() #5230
  563. * fix(connection): don't throw if .catch() on open() promise #5229
  564. * fix(schema): allow update with $currentDate for updatedAt to succeed #5222
  565. * fix(model): versioning doesn't fail if version key undefined #5221 [basileos](https://github.com/basileos)
  566. * fix(document): don't emit model error if callback specified for consistency with docs #5216
  567. * fix(document): handle errors in subdoc pre validate #5215
  568. 4.9.8 / 2017-05-07
  569. ==================
  570. * docs(subdocs): rewrite subdocs guide #5217
  571. * fix(document): avoid circular JSON if error in doc array under single nested subdoc #5208
  572. * fix(document): set intermediate empty objects for deeply nested undefined paths before path itself #5206
  573. * fix(schema): throw error if first param to schema.plugin() is not a function #5201
  574. * perf(document): major speedup in validating subdocs (50x in some cases) #5191
  575. 4.9.7 / 2017-04-30
  576. ==================
  577. * docs: fix typo #5204 [phutchins](https://github.com/phutchins)
  578. * fix(schema): ensure correct path for deeply nested schema indexes #5199
  579. * fix(schema): make remove a reserved name #5197
  580. * fix(model): handle Decimal type in insertMany correctly #5190
  581. * fix: upgrade kareem to handle async pre hooks correctly #5188
  582. * docs: add details about unique not being a validator #5179
  583. * fix(validation): handle returning a promise with isAsync: true #5171
  584. 4.9.6 / 2017-04-23
  585. ==================
  586. * fix: update `parentArray` references when directly assigning document arrays #5192 [jhob](https://github.com/jhob)
  587. * docs: improve schematype validator docs #5178 [milesbarr](https://github.com/milesbarr)
  588. * fix(model): modify discriminator() class in place #5175
  589. * fix(model): handle bulkWrite updateMany casting #5172 [tzellman](https://github.com/tzellman)
  590. * docs(model): fix replaceOne example for bulkWrite #5168
  591. * fix(document): don't create a new array subdoc when creating schema array #5162
  592. * fix(model): merge query hooks from discriminators #5147
  593. * fix(document): add parent() function to subdocument to match array subdoc #5134
  594. 4.9.5 / 2017-04-16
  595. ==================
  596. * fix(query): correct $pullAll casting of null #5164 [Sebmaster](https://github.com/Sebmaster)
  597. * docs: add advanced schemas docs for loadClass #5157
  598. * fix(document): handle null/undefined gracefully in applyGetters() #5143
  599. * fix(model): add resolveToObject option for mapReduce with ES6 promises #4945
  600. 4.9.4 / 2017-04-09
  601. ==================
  602. * fix(schema): clone query middleware correctly #5153 #5141 [clozanosanchez](https://github.com/clozanosanchez)
  603. * docs(aggregate): fix typo #5142
  604. * fix(query): cast .$ update to underlying array type #5130
  605. * fix(populate): don't mutate populate result in place #5128
  606. * fix(query): handle $setOnInsert consistent with $set #5126
  607. * docs(query): add strict mode option for findOneAndUpdate #5108
  608. 4.9.3 / 2017-04-02
  609. ==================
  610. * docs: document.js fixes for functions prepended with `$` #5131 [krmannix](https://github.com/krmannix)
  611. * fix: Avoid exception on constructor check #5129 [monkbroc](https://github.com/monkbroc)
  612. * docs(schematype): explain how to use `isAsync` with validate() #5125
  613. * docs(schematype): explain custom message with required function #5123
  614. * fix(populate): only apply refPath duplicate id optimization if not array #5114
  615. * fix(document): copy non-objects to doc when init() #5111
  616. * perf(populate): dont clone whole options every time #5103
  617. * feat(document): add isDirectSelected() to minimize isSelected() changes #5063
  618. * docs(schematypes): explain some subtleties with arrays #5059
  619. 4.9.2 / 2017-03-26
  620. ==================
  621. * fix(discriminator): handle class names consistently #5104
  622. * fix(schema): make clone() work with reusing discriminator schemas #5098
  623. * fix(querycursor): run pre find hooks with .cursor() #5096
  624. * fix(connection): throw error if username:password includes @ or : #5091
  625. * fix(timestamps): handle overwriting createdAt+updatedAt consistently #5088
  626. * fix(document): ensure subdoc post save runs after parent save #5085
  627. * docs(model): improve update docs #5076 [bertolo1988](https://github.com/bertolo1988)
  628. 4.9.1 / 2017-03-19
  629. ==================
  630. * fix(query): handle $type for arrays #5080 #5079 [zoellner](https://github.com/zoellner)
  631. * fix(model): handle ordered param for `insertMany` validation errors #5072 [sjorssnoeren](https://github.com/sjorssnoeren)
  632. * fix(populate): avoid duplicate ids in dynref queries #5054
  633. * fix(timestamps): dont set timestamps in update if user set it #5045
  634. * fix(update): dont double-call setters on arrays #5041
  635. * fix: upgrade driver -> 2.2.25 for jest fix #5033
  636. * fix(model): get promise each time save() is called rather than once #5030
  637. * fix(connection): make connect return value consistent #5006
  638. 4.9.0 / 2017-03-13
  639. ==================
  640. * feat(document): return this from `depopulate()` #5027
  641. * fix(drivers): stop emitting timeouts as errors #5026
  642. * feat(schema): add a clone() function for schemas #4983
  643. * feat(query): add rawResult option to replace passRawResult, deprecate passRawResult #4977 #4925
  644. * feat(schematype): support isAsync validator option and handle returning promises from validators, deprecate implicit async validators #4290
  645. * feat(query): add `replaceOne()`, `deleteOne()`, `deleteMany()` #3998
  646. * feat(model): add `bulkWrite()` #3998
  647. 4.8.7 / 2017-03-12
  648. ==================
  649. * fix(model): if last arg in spread is falsy, treat it as a callback #5061
  650. * fix(document): use $hook instead of hook to enable 'hook' as a path name #5047
  651. * fix(populate): dont select foreign field if parent field is selected #5037
  652. * fix(populate): handle passing no args to query.populate #5036
  653. * fix(update): use correct method for casting nested arrays #5032
  654. * fix(discriminator): handle array discriminators when casting $push #5009
  655. 4.8.6 / 2017-03-05
  656. ==================
  657. * docs(document): remove text that implies that transform is false by default #5023
  658. * fix(applyHooks): dont wrap a function if it is already wrapped #5019
  659. * fix(document): ensure nested docs' toObject() clones #5008
  660. 4.8.5 / 2017-02-25
  661. ==================
  662. * fix: check for empty schemaPath before accessing property $isMongooseDocumentArray #5017 [https://github.com/randyhoulahan](randyhoulahan)
  663. * fix(discriminators): handle create() and push() for embedded discriminators #5001
  664. * fix(querycursor): ensure close emitted after last data event #4998
  665. * fix(discriminators): remove fields not selected in child when querying by base model #4991
  666. 4.8.4 / 2017-02-19
  667. ==================
  668. * docs(discriminators): explain embedded discriminators #4997
  669. * fix(query): fix TypeError when findOneAndUpdate errors #4990
  670. * fix(update): handle nested single embedded in update validators correctly #4989
  671. * fix(browser): make browser doc constructor not crash #4987
  672. 4.8.3 / 2017-02-15
  673. ==================
  674. * chore: upgrade mongodb driver -> 2.2.24
  675. * docs(connections): addd some details about callbacks #4986
  676. * fix: ensure class is created with new keyword #4972 #4947 [benhjames](https://github.com/benhjames)
  677. * fix(discriminator): add applyPluginsToDiscriminators option #4965
  678. * fix(update): properly cast array subdocs when casting update #4960
  679. * fix(populate): ensure foreign field is selected for virtual populate #4959
  680. * docs(query): document some query callback params #4949
  681. * fix(document): ensure errors in validators get caught #2185
  682. 4.8.2 / 2017-02-10
  683. ==================
  684. * fix(update): actually run validators on addToSet #4953
  685. * fix(update): improve buffer error handling #4944 [ValYouW](https://github.com/ValYouW)
  686. * fix(discriminator): handle subclassing with loadClass correctly #4942
  687. * fix(query): allow passing Map to sort() #4941
  688. * fix(document): handle setting discriminator doc #4935
  689. * fix(schema): return correct value from pre init hook #4928
  690. * fix(query): ensure consistent params in error handlers if pre hook errors #4927
  691. 4.8.1 / 2017-01-30
  692. ==================
  693. * fix(query): handle $exists for arrays and embedded docs #4937
  694. * fix(query): handle passing string to hint() #4931
  695. 4.8.0 / 2017-01-28
  696. ==================
  697. * feat(schema): add saveErrorIfNotFound option and $where property #4924 #4004
  698. * feat(query): add $in implicitly if passed an array #4912 [QuotableWater7](https://github.com/QuotableWater7)
  699. * feat(aggregate): helper for $facet #4904 [varunjayaraman](https://github.com/varunjayaraman)
  700. * feat(query): add collation method #4839
  701. * feat(schema): propogate strict option to implicit array subschemas #4831 [dkrosso](https://github.com/dkrosso)
  702. * feat(aggregate): add helper for graphLookup #4819 [varunjayaraman](https://github.com/varunjayaraman)
  703. * feat(types): support Decimal128 #4759
  704. * feat(aggregate): add eachAsync() to aggregate cursor #4300
  705. * feat(query): add updateOne and updateMany #3997
  706. * feat(model): support options for insertMany #3893
  707. * fix(document): run validation on single nested docs if not directly modified #3884
  708. * feat(model): use discriminator constructor based on discriminatorKey in create() #3624
  709. * feat: pass collection as context to debug function #3261
  710. * feat(query): support push and addToSet for update validators #2933
  711. * perf(document): refactor registerHooksFromSchema so hooks are defined on doc prototype #2754
  712. * feat(types): add discriminator() function to doc arrays #2723 #1856
  713. * fix(populate): return an error if sorting underneath a doc array #2202
  714. 4.7.9 / 2017-01-27
  715. ==================
  716. * fix(query): handle casting $exists under $not #4933
  717. * chore: upgrade mongodb -> 2.2.22 re: #4931
  718. 4.7.8 / 2017-01-23
  719. ==================
  720. * fix(populate): better handling for virtual populate under arrays #4923
  721. * docs: upgrade contributors count #4918 [AdamZaczek](https://github.com/AdamZaczek)
  722. * fix(query): don't set nested path default if setting parent path #4911
  723. * docs(promise): add missing bracket #4907
  724. * fix(connection): ensure error handling is consistently async #4905
  725. * fix: handle authMechanism in query string #4900
  726. * fix(document): ensure error handlers run for validate #4885
  727. 4.7.7 / 2017-01-15
  728. ==================
  729. * fix(utils): don't crash if to[key] is null #4881
  730. * fix: upgrade mongodb -> 2.2.21 #4867
  731. * fix: add a toBSON to documents for easier querying #4866
  732. * fix: suppress bluebird warning #4854 [davidwu226](https://github.com/davidwu226)
  733. * fix(populate): handle nested virtuals in virtual populate #4851
  734. 4.7.6 / 2017-01-02
  735. ==================
  736. * fix(model): allow passing non-array to insertMany #4846
  737. * fix(populate): use base model name if no discriminator for backwards compat #4843
  738. * fix: allow internal validate callback to be optional #4842 [arciisine](https://github.com/arciisine)
  739. * fix(document): don't skip pointCut if save not defined (like in browser doc) #4841
  740. * chore: improve benchmarks #4838 [billouboq](https://github.com/billouboq)
  741. * perf: remove some unused parameters #4837 [billouboq](https://github.com/billouboq)
  742. * fix(query): don't call error handler if passRawResult is true and no error occurred #4836
  743. 4.7.5 / 2016-12-26
  744. ==================
  745. * docs(model): fix spelling mistake #4828 [paulinoj](https://github.com/paulinoj)
  746. * fix(aggregate): remove unhandled rejection when using aggregate.then() #4824
  747. * perf: remove try/catch that kills optimizer #4821
  748. * fix(model): handles populating with discriminators that may not have a ref #4817
  749. * fix(document): handle setting array of discriminators #3575
  750. 4.7.4 / 2016-12-21
  751. ==================
  752. * docs: fix typo #4810 [GEEKIAM](https://github.com/GE…