UNPKG

307 kBMarkdownView Raw
15.9.17 / 2020-06-02
2===================
3 * fix(document): avoid tracking changes like `splice()` on slice()-ed arrays #9011
4 * fix(populate): make populating a nested path a no-op #9073
5 * fix(document): clear nested cast errors when overwriting an array path #9080
6 * fix: upgrade mongodb to v3.5.8 #9069 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
7 * docs(document): add validateModifiedOnly to Document#save(), Document#validateSync() and Document#validate() #9078 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
8 * docs(faq): fix typo #9075 [tigransimonyan](https://github.com/tigransimonyan)
9 * docs: document all parameters to .debug #9029 [dandv](https://github.com/dandv)
10 * docs: fix property value in Getters example #9061 [ismet](https://github.com/ismet)
11
125.9.16 / 2020-05-25
13===================
14 * perf(error): convert errors to classes extending Error for lower CPU overhead #9021 [zbjornson](https://github.com/zbjornson)
15 * fix(query): throw CastError if filter `$and`, `$or`, `$nor` contain non-object values #8948
16 * fix(bulkwrite): cast filter & update to schema after applying timestamps #9030 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
17 * fix(document): don't overwrite defaults with undefined keys in nested documents #9039 [vitorhnn](https://github.com/vitorhnn)
18 * fix(discriminator): remove discriminator schema nested paths pulled from base schema underneath a mixed path in discriminator schema #9042
19 * fix(model): make syncIndexes() not drop index if all user-specified collation options are the same #8994
20 * fix(document): make internal `$__.scope` property a symbol instead to work around a bug with fast-safe-stringify #8955
21 * docs: model.findByIdAndUpdate() 'new' param fix #9026 [dandv](https://github.com/dandv)
22
235.9.15 / 2020-05-18
24===================
25 * fix(schema): treat creating dotted path with no parent as creating a nested path #9020
26 * fix(documentarray): make sure you can call `unshift()` after `map()` #9012 [philippejer](https://github.com/philippejer)
27 * fix(model): cast bulkwrite according to discriminator schema if discriminator key is present #8982 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
28 * fix(schema): remove `db` from reserved keywords #8940
29 * fix(populate): treat populating a doc array that doesn't have a `ref` as a no-op #8946
30 * fix(timestamps): set createdAt and updatedAt on doubly nested subdocs when upserting #8894
31 * fix(model): allow POJOs as schemas for model.discriminator(...) #8991 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
32 * fix(model): report `insertedDocs` on `insertMany()` errors #8938
33 * fix(model): ensure consistent `writeErrors` property on insertMany error with `ordered: false`, even if only one op failed #8938
34 * docs: add anchor tag to strictQuery and strict #9014 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
35 * docs(faq): remove faq ipv6 #9004
36 * docs: add note about throwing error only after validation and fix broken reference to api/CastError #8993 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
37 * docs: fix typos in documents.pug #9005 [dandv](https://github.com/dandv)
38
395.9.14 / 2020-05-13
40===================
41 * fix(cursor): add index as second parameter to eachAsync callback #8972 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
42 * fix(query): cast filter according to discriminator schema if discriminator key in filter #8881
43 * fix(model): fix throwing error when populating virtual path defined on child discriminator #8924 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
44 * fix(errors): handle case when user has make `Error.prototype.toJSON` read only #8986 [osher](https://github.com/osher)
45 * fix(model): add `kind` to cast errors thrown by query execution #8953 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
46 * fix(update): use child schema strict on single nested updates if useNestedStrict not set #8922
47 * docs(model): improve `save()` docs #8956 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
48 * docs: add immutable type to Schema Types #8987 [Andrew5569](https://github.com/Andrew5569)
49 * docs: sort schema reserved keys in documentation #8966 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
50
515.9.13 / 2020-05-08
52===================
53 * fix(schema): mark correct path as modified when setting a path underneath a nested array of documents #8926
54 * fix(query): Query#select({ field: false }) should not overwrite schema selection options #8929 #8923
55 * fix(update): handle immutable properties are ignored in bulk upserts #8952 [philippejer](https://github.com/philippejer)
56 * docs(browser): add back sample webpack config #8890
57 * docs(faq): fix broken reference in limit vs perDocumentLimit #8937
58
595.9.12 / 2020-05-04
60===================
61 * fix(document): report cast error on array elements with array index instead of just being a cast error for the whole array #8888
62 * fix(connection): throw more helpful error in case of IP whitelisting issue with Atlas #8846
63 * fix(schema): throw error on schema with reserved key with type of object #8869 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
64 * fix(connection): inherit config for useDB from default connection #8267 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
65 * fix(query): set mongodb options for `distinct()` #8906 [clhuang](https://github.com/clhuang)
66 * fix(schema): allow adding descending indexes on schema #8895 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
67 * fix(document): set defaults if setting nested path to empty object with `minimize: false` #8829
68 * fix(populate): check discriminator existence before accessing schema in getModelsMapForPopulate #8837 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
69 * docs: fix broken references to Mongoose#Document API, and prefer mongoose.model(...) over Document#model(...) #8914 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
70 * docs(model): adds options.limit to Model.insertMany(...) #8864 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
71 * docs: add flattenMaps and aliases to Document#toObject() #8901 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
72 * docs(model): add options.overwrite to findOneAndUpdate #8865 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
73 * docs(populate+faq): separate limit-vs-perDocumentLimit into its own section, add FAQ for populate and limit #8917 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
74
755.9.11 / 2020-04-30
76===================
77 * fix: upgrade mongodb driver -> 3.5.7 #8842 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
78 * fix: validate nested paths on Model.validate(...) #8848 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
79 * fix(populate): make doc.execPopulate(options) a shorthand for doc.populate(options).execPopulate() #8840 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
80 * fix(model): return validation errors when all docs are invalid & rawResult set #8853 [tusharf5](https://github.com/tusharf5)
81 * fix(schemaType): treat select: null or select: undefined as not specified #8850 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
82 * fix: fix stream close event listener being called multiple times in Node 14 #8835 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
83 * fix(populate): handle `clone` with `lean` when setting a path to `null` #8807
84 * docs(faq): clarify setting paths under document arrays with `markModified()` #8854
85 * docs: fix race condition in creating connection for lambda #8845 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
86 * docs: add options.path for Model.populate(...) #8833 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
87 * docs: use ES6 classes for custom schema type example #8802
88
895.9.10 / 2020-04-20
90===================
91 * fix: upgrade mongodb -> 3.5.6, bson -> 1.1.4 #8719
92 * fix(document): avoid calling `$set()` on object keys if object path isn't in schema #8751
93 * fix(timestamps): handle timestamps on doubly nested subdocuments #8799
94 * fix(schematype): throw error if default is set to a schema instance #8751
95 * fix: handle $elemMatch projection with `select: false` in schema #8818 #8806 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
96 * docs: make FAQ questions more linkable #8825 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
97 * docs(validation): use `init()` as opposed to `once('index')` in `unique` example #8816
98 * docs: clarify `insertMany()` return value #8820 [dandv](https://github.com/dandv)
99 * docs(populate+query): fix typos #8793 #8794 [dandv](https://github.com/dandv)
100 * docs(model): document skipId parameter #8791 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
101
1025.9.9 / 2020-04-13
103==================
104 * fix(model): make Model.bulkWrite accept `strict` option #8782 #8788 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
105 * fix(virtual): make populated virtual getter return value when it is passed in #8775 #8774 [makinde](https://github.com/makinde)
106 * fix(document): handle validating document array whose docs contain maps and nested paths #8767
107 * fix(document): skip discriminator key when overwriting a document #8765
108 * fix(populate): support `clone` option with `lean` #8761 #8760
109 * docs(transactions): use `endSession()` in all transactions examples #8741
110 * docs(queries): expand streaming section to include async iterators, cursor timeouts, and sesssion idle timeouts #8720
111 * docs(model+query+findoneandupdate): add docs for `returnOriginal` option #8766
112 * docs(model): fix punctuation #8788 [dandv](https://github.com/dandv)
113 * docs: fix typos #8780 #8799 [dandv](https://github.com/dandv)
114
1155.9.8 / 2020-04-06
116==================
117 * fix(map): run getters when calling `Map#get()` #8730
118 * fix(populate): handle `refPath` function in embedded discriminator #8731
119 * fix(model): allow setting timestamps to false for bulkWrite #8758 #8745 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
120 * fix(model): pass custom options to `exists()` when no changes to save #8764 #8739 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
121 * fix(update): respect `useNestedStrict: false` when updating a single nested path #8735
122 * fix(schema): allow `modelName` as a schema path, since `modelName` is a static property on models #7967
123 * docs(promises): add section about using `exec()` with queries and `await` #8747
124 * docs(connections): clarify that `connectTimeoutMS` doesn't do anything with `useUnifiedTopology`, should use `serverSelectionTimeoutMS` #8721
125 * chore: upgrade mpath -> 0.7.0 #8762 [roja548](https://github.com/roja548)
126
1275.9.7 / 2020-03-30
128==================
129 * fix(map): avoid infinite loop when setting a map of documents to a document copied using spread operator #8722
130 * fix(query): clean stack trace for filter cast errors so they include the calling file #8691
131 * fix(model): make bulkWrite updates error if `strict` and `upsert` are set and `filter` contains a non-schema path #8698
132 * fix(cast): make internal `castToNumber()` allow undefined #8725 [p3x-robot](https://github.com/p3x-robot)
133
1345.9.6 / 2020-03-23
135==================
136 * fix(document): allow saving document with nested document array after setting `nestedArr.0` #8689
137 * docs(connections): expand section about multiple connections to describe patterns for exporting schemas #8679
138 * docs(populate): add note about `execPopulate()` to "populate an existing document" section #8671 #8275
139 * docs: fix broken links #8690 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
140 * docs(guide): fix typos #8704 [MateRyze](https://github.com/MateRyze)
141 * docs(guide): fix minor typo #8683 [pkellz](https://github.com/pkellz)
142
1435.9.5 / 2020-03-16
144==================
145 * fix: upgrade mongodb driver -> 3.5.5 #8667 #8664 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
146 * fix(connection): emit "disconnected" after losing connectivity to every member of a replica set with `useUnifiedTopology: true` #8643
147 * fix(array): allow calling `slice()` after `push()` #8668 #8655 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
148 * fix(map): avoid marking map as modified if setting `key` to the same value #8652
149 * fix(updateValidators): don't run `Mixed` update validator on dotted path underneath mixed type #8659
150 * fix(populate): ensure top-level `limit` applies if one document being populated has more than `limit` results #8657
151 * fix(populate): throw error if both `limit` and `perDocumentLimit` are set #8661 #8658 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
152 * docs(findOneAndUpdate): add a section about the `rawResult` option #8662
153 * docs(guide): add section about `loadClass()` #8623
154 * docs(query): improve `Query#populate()` example to clarify that `sort` doesn't affect the original result's order #8647
155
1565.9.4 / 2020-03-09
157==================
158 * fix(document): allow `new Model(doc)` to set immutable properties when doc is a mongoose document #8642
159 * fix(array): make sure you can call `unshift()` after `slice()` #8482
160 * fix(schema): propagate `typePojoToMixed` to implicitly created arrays #8627
161 * fix(schema): also propagate `typePojoToMixed` option to schemas implicitly created because of `typePojoToMixed` #8627
162 * fix(model): support passing `background` option to `syncIndexes()` #8645
163 * docs(schema): add a section about the `_id` path in schemas #8625
164 * docs(virtualtype+populate): document using `match` with virtual populate #8616
165 * docs(guide): fix typo #8648 [sauzy34](https://github.com/sauzy34)
166
1675.9.3 / 2020-03-02
168==================
169 * fix: upgrade mongodb driver -> 3.5.4 #8620
170 * fix(document): set subpath defaults when overwriting single nested subdoc #8603
171 * fix(document): make calling `validate()` with single nested subpath only validate that single nested subpath #8626
172 * fix(browser): make `mongoose.model()` return a class in the browser to allow hydrating populated data in the browser #8605
173 * fix(model): make `syncIndexes()` and `cleanIndexes()` drop compound indexes with `_id` that aren't in the schema #8559
174 * docs(connection+index): add warnings to explain that bufferMaxEntries does nothing with `useUnifiedTopology` #8604
175 * docs(document+model+query): add `options.timestamps` parameter docs to `findOneAndUpdate()` and `findByIdAndUpdate()` #8619
176 * docs: fix out of date links to tumblr #8599
177
1785.9.2 / 2020-02-21
179==================
180 * fix(model): add discriminator key to bulkWrite filters #8590
181 * fix(document): when setting nested array path to non-nested array, wrap values top-down rather than bottom up when possible #8544
182 * fix(document): dont leave nested key as undefined when setting nested key to empty object with minimize #8565
183 * fix(document): avoid throwing error if setting path to Mongoose document with nullish `_doc` #8565
184 * fix(update): handle Binary type correctly with `runValidators` #8580
185 * fix(query): run `deleteOne` hooks only on `Document#deleteOne()` when setting `options.document = true` for `Schema#pre()` #8555
186 * fix(document): allow calling `validate()` in post validate hook without causing parallel validation error #8597
187 * fix(virtualtype): correctly copy options when cloning #8587
188 * fix(collection): skip creating capped collection if `autoCreate` set to `false` #8566
189 * docs(middleware): clarify that updateOne and deleteOne hooks are query middleware by default, not document middleware #8581
190 * docs(aggregate): clarify that `Aggregate#unwind()` can take object parameters as well as strings #8594
191
1925.9.1 / 2020-02-14
193==================
194 * fix(model): set session when calling `save()` with no changes #8571
195 * fix(schema): return correct pathType when single nested path is embedded under a nested path with a numeric name #8583
196 * fix(queryhelpers): remove `Object.values()` for Node.js 4.x-6.x support #8596
197 * fix(cursor): respect sort order when using `eachAsync()` with `parallel` and a sync callback #8577
198 * docs: update documentation of custom _id overriding in discriminators #8591 [sam-mfb](https://github.com/sam-mfb)
199
2005.9.0 / 2020-02-13
201==================
202 * fix: upgrade to MongoDB driver 3.5 #8520 #8563
203 * feat(schematype): support setting default options for schema type (`trim` on all strings, etc.) #8487
204 * feat(populate): add `perDocumentLimit` option that limits per document in `find()` result, rather than across all documents #7318
205 * feat(schematype): enable setting `transform` option on individual schematypes #8403
206 * feat(timestamps): allow setting `currentTime` option for setting custom function to get the current time #3957
207 * feat(connection): add `Connection#watch()` to watch for changes on an entire database #8425
208 * feat(document): add `Document#$op` property to make it easier to tell what operation is running in middleware #8439
209 * feat(populate): support `limit` as top-level populate option #8445
210
2115.8.13 / 2020-02-13
212===================
213 * fix(populate): use safe get to avoid crash if schematype doesn't have options #8586
214
2155.8.12 / 2020-02-12
216===================
217 * fix(query): correctly cast dbref `$id` with `$elemMatch` #8577
218 * fix(populate): handle populating when some embedded discriminator schemas have `refPath` but none of the subdocs have `refPath` #8553
219 * docs: add useUnifiedTopology to homepage example #8558 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
220 * refactor(utils): moving promiseOrCallback to helpers/promiseOrCallback #8573 [hugosenari](https://github.com/hugosenari)
221
2225.8.11 / 2020-01-31
223===================
224 * fix(document): allow calling `validate()` multiple times in parallel on subdocs to avoid errors if Mongoose double-validates [taxilian](https://github.com/taxilian) #8548 #8539
225 * fix(connection): allow calling initial `mongoose.connect()` after connection helpers on the same tick #8534
226 * fix(connection): throw helpful error when callback param to `mongoose.connect()` or `mongoose.createConnection()` is not a function #8556
227 * fix(drivers): avoid unnecessary caught error when importing #8528
228 * fix(discriminator): remove unnecessary `utils.merge()` [samgladstone](https://github.com/samgladstone) #8542
229 * docs: add "built with mongoose" page #8540
230
2315.8.10 / 2020-01-27
232===================
233 * perf(document): improve performance of document creation by skipping unnecessary split() calls #8533 [igrunert-atlassian](https://github.com/igrunert-atlassian)
234 * fix(document): only call validate once for deeply nested subdocuments #8532 #8531 [taxilian](https://github.com/taxilian)
235 * fix(document): create document array defaults in forward order, not reverse #8514
236 * fix(document): allow function as message for date min/max validator #8512
237 * fix(populate): don't try to populate embedded discriminator that has populated path but no `refPath` #8527
238 * fix(document): plugins from base schema when creating a discriminator #8536 [samgladstone](https://github.com/samgladstone)
239 * fix(document): ensure parent and ownerDocument are set for subdocs in document array defaults #8509
240 * fix(document): dont set undefined keys to null if minimize is false #8504
241 * fix(update): bump timestamps when using update aggregation pipelines #8524
242 * fix(model): ensure `cleanIndexes()` drops indexes with different collations #8521
243 * docs(model): document `insertMany` `lean` option #8522
244 * docs(connections): document `authSource` option #8517
245
2465.8.9 / 2020-01-17
247==================
248 * fix(populate): skip populating embedded discriminator array values that don't have a `refPath` #8499
249 * docs(queries): clarify when to use queries versus aggregations #8494
250
2515.8.8 / 2020-01-14
252==================
253 * fix(model): allow using `lean` with `insertMany()` #8507 #8234 [ntsekouras](https://github.com/ntsekouras)
254 * fix(document): don't throw parallel validate error when validating subdoc underneath modified nested path #8486
255 * fix: allow `typePojoToMixed` as top-level option #8501 #8500 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
256 * docs(populate+schematypes): make note of `_id` getter for ObjectIds in populate docs #8483
257
2585.8.7 / 2020-01-10
259==================
260 * fix(documentarray): modify ownerDocument when setting doc array to a doc array thats part of another document #8479
261 * fix(document): ensure that you can call `splice()` after `slice()` on an array #8482
262 * docs(populate): improve cross-db populate docs to include model refs #8497
263
2645.8.6 / 2020-01-07
265====================
266 * chore: merge changes from 4.13.20 and override mistaken publish to latest tag
267
2684.13.20 / 2020-01-07
269====================
270 * fix(schema): make aliases handle mongoose-lean-virtuals #6069
271
2725.8.5 / 2020-01-06
273==================
274 * fix(document): throw error when running `validate()` multiple times on the same document #8468
275 * fix(model): ensure deleteOne() and deleteMany() set discriminator filter even if no conditions passed #8471
276 * fix(document): allow pre('validate') hooks to throw errors with `name = 'ValidationError'` #8466
277 * fix(update): move top level $set of immutable properties to $setOnInsert so upserting with immutable properties actually sets the property #8467
278 * fix(document): avoid double-running validators on single nested subdocs within single nested subdocs #8468
279 * fix(populate): support top-level match option for virtual populate #8475
280 * fix(model): avoid applying skip when populating virtual with count #8476
281
2825.8.4 / 2020-01-02
283==================
284 * fix(populate): ensure populate virtual gets set to empty array if `localField` is undefined in the database #8455
285 * fix(connection): wrap `mongoose.connect()` server selection timeouts in MongooseTimeoutError for more readable stack traces #8451
286 * fix(populate): allow deselecting `foreignField` from projection by prefixing with `-` #8460
287 * fix(populate): support embedded discriminators with `refPath` when not all discriminator schemas have `refPath` #8452
288 * fix(array): allow defining `enum` on array if an array of numbers #8449
289
2905.8.3 / 2019-12-23
291==================
292 * fix: upgrade mongodb -> 3.4.1 #8430 [jaschaio](https://github.com/jaschaio)
293 * fix(populate): don't add empty subdocument to array when populating path underneath a non-existent document array #8432
294 * fix(schema): handle `_id` option for document array schematypes #8450
295 * fix(update): call setters when updating mixed type #8444
296 * docs(connections): add note about MongoTimeoutError.reason #8402
297
2985.8.2 / 2019-12-20
299==================
300 * fix(schema): copy `.add()`-ed paths when calling `.add()` with schema argument #8429
301 * fix(cursor): pull schema-level readPreference when using `Query#cursor()` #8421
302 * fix(cursor): wait for all promises to resolve if `parallel` is greater than number of documents #8422
303 * fix(document): depopulate entire array when setting array path to a partially populated array #8443
304 * fix: handle setDefaultsOnInsert with deeply nested subdocs #8392
305 * fix(document): report `DocumentNotFoundError` if underlying document deleted but no changes made #8428 #8371 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
306 * docs(populate): clarify limitations of `limit` option for populate and suggest workaround #8409
307 * docs(deprecations): explain which connection options are no longer relevant with useUnifiedTopology #8411
308 * chore: allow browser build to be published #8435 #8427 [captaincaius](https://github.com/captaincaius)
309
3105.8.1 / 2019-12-12
311==================
312 * fix(documentarray): dont attempt to cast when modifying array returned from map() #8399
313 * fix(document): update single nested subdoc parent when setting to existing single nested doc #8400
314 * fix(schema): add `$embeddedSchemaType` property to arrays for consistency with document arrays #8389
315
3165.8.0 / 2019-12-09
317==================
318 * feat: wrap server selection timeout errors in `MongooseTimeoutError` to retain original stack trace #8259
319 * feat(model): add `Model.validate()` function that validates a POJO against the model's schema #7587
320 * feat(schema): add `Schema#pick()` function to create a new schema with a picked subset of the original schema's paths #8207
321 * feat(schema): add ability to change CastError message using `cast` option to SchemaType #8300
322 * feat(schema): group indexes defined in schema path with the same name #6499
323 * fix(model): build all indexes even if one index fails #8185 [unusualbob](https://github.com/unusualbob)
324 * feat(browser): pre-compile mongoose/browser #8350 [captaincaius](https://github.com/captaincaius)
325 * fix(connection): throw error when setting unsupported option #8335 #6899 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
326 * feat(schema): support `enum` validator for number type #8139
327 * feat(update): allow using MongoDB 4.2 update aggregation pipelines, with no Mongoose casting #8225
328 * fix(update): make update validators run on all subpaths when setting a nested path, even omitted subpaths #3587
329 * feat(schema): support setting `_id` as an option to single nested schema paths #8137
330 * feat(query): add Query#mongooseOptions() function #8296
331 * feat(array): make `MongooseArray#push()` support using `$position` #4322
332 * feat(schema): make pojo paths optionally become subdoc instead of Mixed #8228 [captaincaius](https://github.com/captaincaius)
333 * feat(model): add Model.cleanIndexes() to drop non-schema indexes #6676
334 * feat(document): make `updateOne()` document middleware pass `this` to post hooks #8262
335 * feat(aggregate): run pre/post aggregate hooks on `explain()` #5887
336 * docs(model+query): add `session` option to docs for findOneAndX() methods #8396
337
3385.7.14 / 2019-12-06
339===================
340 * fix(cursor): wait until all `eachAsync()` functions finish before resolving the promise #8352
341 * fix(update): handle embedded discriminator paths when discriminator key is defined in the update #8378
342 * fix(schematype): handle passing `message` function to `SchemaType#validate()` as positional arg #8360
343 * fix(map): handle cloning a schema that has a map of subdocuments #8357
344 * docs(schema): clarify that `uppercase`, `lowercase`, and `trim` options for SchemaString don't affect RegExp queries #8333
345
3465.7.13 / 2019-11-29
347===================
348 * fix: upgrade mongodb driver -> 3.3.5 #8383
349 * fix(model): catch the error when insertMany fails to initialize the document #8365 #8363 [Fonger](https://github.com/Fonger)
350 * fix(schema): add array.$, array.$.$ subpaths for nested arrays #6405
351 * docs(error): add more detail about the ValidatorError class, including properties #8346
352 * docs(connection): document `Connection#models` property #8314
353
3545.7.12 / 2019-11-19
355===================
356 * fix: avoid throwing error if calling `push()` on a doc array with no parent #8351 #8317 #8312 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
357 * fix(connection): only buffer for "open" events when calling connection helper while connecting #8319
358 * fix(connection): pull default database from connection string if specified #8355 #8354 [zachazar](https://github.com/zachazar)
359 * fix(populate+discriminator): handle populating document whose discriminator value is different from discriminator model name #8324
360 * fix: add `mongoose.isValidObjectId()` function to test whether Mongoose can cast a value to an objectid #3823
361 * fix(model): support setting `excludeIndexes` as schema option for subdocs #8343
362 * fix: add SchemaMapOptions class for options to map schematype #8318
363 * docs(query): remove duplicate omitUndefined options #8349 [mdumandag](https://github.com/mdumandag)
364 * docs(schema): add Schema#paths docs to public API docs #8340
365
3665.7.11 / 2019-11-14
367===================
368 * fix: update mongodb driver -> 3.3.4 #8276
369 * fix(model): throw readable error when casting bulkWrite update without a 'filter' or 'update' #8332 #8331 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
370 * fix(connection): bubble up connected/disconnected events with unified topology #8338 #8337
371 * fix(model): delete $versionError after saving #8326 #8048 [Fonger](https://github.com/Fonger)
372 * test(model): add test for issue #8040 #8341 [Fonger](https://github.com/Fonger)
373
3745.7.10 / 2019-11-11
375===================
376 * perf(cursor): remove unnecessary `setTimeout()` in `eachAsync()`, 4x speedup in basic benchmarks #8310
377 * docs(README): re-order sections for better readability #8321 [dandv](https://github.com/dandv)
378 * chore: make npm test not hard-code file paths #8322 [stieg](https://github.com/stieg)
379
3805.7.9 / 2019-11-08
381==================
382 * fix(schema): support setting schema path to an instance of SchemaTypeOptions to fix integration with mongoose-i18n-localize #8297 #8292
383 * fix(populate): make `retainNullValues` set array element to `null` if foreign doc with that id was not found #8293
384 * fix(document): support getter setting virtual on manually populated doc when calling toJSON() #8295
385 * fix(model): allow objects with `toBSON()` to make it to `save()` #8299
386
3875.7.8 / 2019-11-04
388==================
389 * fix(document): allow manually populating path within document array #8273
390 * fix(populate): update top-level `populated()` when updating document array with populated subpaths #8265
391 * fix(cursor): throw error when using aggregation cursor as async iterator #8280
392 * fix(schema): retain `_id: false` in schema after nesting in another schema #8274
393 * fix(document): make Document class an event emitter to support defining documents without models in node #8272
394 * docs: document return types for `.discriminator()` #8287
395 * docs(connection): add note about exporting schemas, not models, in multi connection paradigm #8275
396 * docs: clarify that transforms defined in `toObject()` options are applied to subdocs #8260
397
3985.7.7 / 2019-10-24
399==================
400 * fix(populate): make populate virtual consistently an empty array if local field is only empty arrays #8230
401 * fix(query): allow findOne(objectid) and find(objectid) #8268
402
4035.7.6 / 2019-10-21
404==================
405 * fix: upgrade mongodb driver -> 3.3.3 to fix issue with failing to connect to a replica set if one member is down #8209
406 * fix(document): fix TypeError when setting a single nested subdoc with timestamps #8251
407 * fix(cursor): fix issue with long-running `eachAsync()` cursor #8249 #8235
408 * fix(connection): ensure repeated `close` events from useUnifiedTopology don't disconnect Mongoose from replica set #8224
409 * fix(document): support calling `Document` constructor directly in Node.js #8237
410 * fix(populate): add document array subpaths to parent doc `populated()` when calling `DocumentArray#push()` #8247
411 * fix(options): add missing minlength and maxlength to SchemaStringOptions #8256
412 * docs: add documentarraypath to API docs, including DocumentArrayPath#discriminator() #8164
413 * docs(schematypes): add a section about the `type` property #8227
414 * docs(api): fix Connection.close return param #8258 [gosuhiman](https://github.com/gosuhiman)
415 * docs: update link to broken image on home page #8253 [krosenk729](https://github.com/krosenk729)
416
4175.7.5 / 2019-10-14
418==================
419 * fix(query): delete top-level `_bsontype` property in queries to prevent silent empty queries #8222
420 * fix(update): handle subdocument pre('validate') errors in update validation #7187
421 * fix(subdocument): make subdocument#isModified use parent document's isModified #8223
422 * docs(index): add favicon to home page #8226
423 * docs: add schema options to API docs #8012
424 * docs(middleware): add note about accessing the document being updated in pre('findOneAndUpdate') #8218
425 * refactor: remove redundant code in ValidationError #8244 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
426
4275.7.4 / 2019-10-09
428==================
429 * fix(schema): handle `required: null` and `required: undefined` as `required: false` #8219
430 * fix(update): support updating array embedded discriminator props if discriminator key in $elemMatch #8063
431 * fix(populate): allow accessing populate virtual prop underneath array when virtual defined on top level #8198
432 * fix(model): support passing `options` to `Model.remove()` #8211
433 * fix(document): handle `Document#set()` merge option when setting underneath single nested schema #8201
434 * fix: use options constructor class for all schematypes #8012
435
4365.7.3 / 2019-09-30
437==================
438 * fix: make CoreMongooseArray#includes() handle `fromIndex` parameter #8203
439 * fix(update): cast right hand side of `$pull` as a query instead of an update for document arrays #8166
440 * fix(populate): handle virtual populate of an embedded discriminator nested path #8173
441 * docs(validation): remove deprecated `isAsync` from validation docs in favor of emphasizing promises #8184
442 * docs(documents): add overwriting section #8178
443 * docs(promises): add note about queries being thenable #8110
444 * perf: avoid update validators going into Mixed types #8192 [birdofpreyru](https://github.com/birdofpreyru)
445 * refactor: remove async as a prod dependency #8073
446
4475.7.2 / 2019-09-23
448==================
449 * fix(mongoose): support `mongoose.set('autoIndex', false)` #8158
450 * fix(discriminator): support `tiedValue` parameter for embedded discriminators analagous to top-level discriminators #8164
451 * fix(query): handle `toConstructor()` with entries-style sort syntax #8159
452 * fix(populate): avoid converting mixed paths into arrays if populating an object path under `Mixed` #8157
453 * fix: use $wrapCallback when using promises for mongoose-async-hooks
454 * fix: handle queries with setter that converts value to Number instance #8150
455 * docs: add mongoosejs-cli to readme #8142
456 * docs: fix example typo for Schema.prototype.plugin() #8175 [anaethoss](https://github.com/anaethoss)
457
4585.7.1 / 2019-09-13
459==================
460 * fix(query): fix TypeError when calling `findOneAndUpdate()` with `runValidators` #8151 [fernandolguevara](https://github.com/fernandolguevara)
461 * fix(document): throw strict mode error if setting an immutable path with strict mode: false #8149
462 * fix(mongoose): support passing options object to Mongoose constructor #8144
463 * fix(model): make syncIndexes() handle changes in index key order #8135
464 * fix(error): export StrictModeError as a static property of MongooseError #8148 [ouyuran](https://github.com/ouyuran)
465 * docs(connection+mongoose): add `useUnifiedTopology` option to `connect()` and `openUri()` docs #8146
466
4675.7.0 / 2019-09-09
468==================
469 * feat(document+query): support conditionally immutable schema paths #8001
470 * perf(documentarray): refactor to use ES6 classes instead of mixins, ~30% speedup #7895
471 * feat: use MongoDB driver 3.3.x for MongoDB 4.2 support #8083 #8078
472 * feat(schema+query): add pre('validate') and post('validate') hooks for update validation #7984
473 * fix(timestamps): ensure updatedAt gets incremented consistently using update with and without $set #4768
474 * feat(query): add `Query#get()` to make writing custom setters that handle both queries and documents easier #7312
475 * feat(document): run setters on defaults #8012
476 * feat(document): add `aliases: false` option to `Document#toObject()` #7548
477 * feat(timestamps): support skipping updatedAt and createdAt for individual save() and update() #3934
478 * docs: fix index creation link in guide #8138 [joebowbeer](https://github.com/joebowbeer)
479
4805.6.13 / 2019-09-04
481===================
482 * fix(parallel): fix parallelLimit when fns is empty #8130 #8128 [sibelius](https://github.com/sibelius)
483 * fix(document): ensure nested mixed validator gets called exactly once #8117
484 * fix(populate): handle `justOne = undefined` #8125 [taxilian](https://github.com/taxilian)
485
4865.6.12 / 2019-09-03
487===================
488 * fix(schema): handle required validator correctly with `clone()` #8111
489 * fix(schema): copy schematype getters and setters when cloning #8124 [StphnDamon](https://github.com/StphnDamon)
490 * fix(discriminator): avoid unnecessarily cloning schema to avoid leaking memory on repeated `discriminator()` calls #2874
491 * docs(schematypes): clarify when Mongoose uses `toString()` to convert an object to a string #8112 [TheTrueRandom](https://github.com/TheTrueRandom)
492 * docs(plugins): fix out of date link to npm docs #8100
493 * docs(deprecations): fix typo #8109 [jgcmarins](https://github.com/jgcmarins)
494 * refactor(model): remove dependency on `async.parallelLimit()` for `insertMany()` #8073
495
4965.6.11 / 2019-08-25
497===================
498 * fix(model): allow passing options to `exists()` #8075
499 * fix(document): make `validateUpdatedOnly` option handle pre-existing errors #8091
500 * fix: throw readable error if middleware callback isnt a function #8087
501 * fix: don't throw error if calling `find()` on a nested array #8089
502 * docs(middleware): clarify that you must add middleware before compiling your model #5087
503 * docs(query): add missing options to `setOptions()` #8099
504
5055.6.10 / 2019-08-20
506===================
507 * fix(schema): fix require() path to work around yet another bug in Jest #8053
508 * fix(document): skip casting when initing a populated path #8062
509 * fix(document): prevent double-calling validators on mixed objects with nested properties #8067
510 * fix(query): handle schematype with `null` options when checking immutability #8070 [rich-earth](https://github.com/rich-earth)
511 * fix(schema): support `Schema#path()` to get schema path underneath doc array #8057
512 * docs(faq): add disable color instruction #8066
513
5145.6.9 / 2019-08-07
515==================
516 * fix(model): delete versionError after saving to prevent memory leak #8048
517 * fix(cursor): correctly handle batchSize option with query cursor #8039
518 * fix(populate): handle virtual populate with count = 0 if virtual embedded in doc array #7573
519 * fix(schema): allow declaring ObjectId array with `{ type: 'ObjectID' }`, last 'D' case insensitive #8034
520
5215.6.8 / 2019-08-02
522==================
523 * fix(aggregate): allow modifying pipeline in pre('aggregate') hooks #8017
524 * fix(query): make `findOneAndReplace()` work with `orFail()` #8030
525 * fix(document): allow saving an unchanged document if required populated path is null #8018
526 * fix(debug): support disabling colors in debug mode #8033 [Mangosteen-Yang](https://github.com/Mangosteen-Yang)
527 * docs: add async-await guide #8028 [Rossh87](https://github.com/Rossh87)
528 * docs(plugins): rewrite plugins docs to be more modern and not use strange `= exports` syntax #8026
529 * docs(transactions): clarify relationship between `session` in docs and MongoDB driver ClientSession class, link to driver docs #8009
530
5315.6.7 / 2019-07-26
532==================
533 * fix(document): support validators on nested arrays #7926
534 * fix(timestamps): handle `timestamps: false` in child schema #8007
535 * fix(query): consistently support `new` option to `findOneAndX()` as an alternative to `returnOriginal` #7846
536 * fix(document): make `inspect()` never return `null`, because a document or nested path is never `== null` #7942
537 * docs(query+lean): add links to mongoose-lean-virtuals, mongoose-lean-getters, mongoose-lean-defaults #5606
538 * docs: add example for `Schema#pre(Array)` #8022 [Mangosteen-Yang](https://github.com/Mangosteen-Yang)
539 * docs(schematype): updated comment from Schema.path to proper s.path #8013 [chrisweilacker](https://github.com/chrisweilacker)
540 * chore: upgrade nyc #8015 [kolya182](https://github.com/kolya182)
541
5425.6.6 / 2019-07-22
543==================
544 * fix(populate): handle refPath returning a virtual with `Query#populate()` #7341
545 * fix(populate): handle `refPath` in discriminator when populating top-level model #5109
546 * fix(mongoose): ensure destucturing and named imports work for Mongoose singleton methods like `set()`, etc. #6039
547 * fix(query): add missing options for deleteOne and deleteMany in Query #8004 [Fonger](https://github.com/Fonger)
548 * fix(schema): make embedded discriminators `instanceof` their parent types #5005
549 * fix(array): make `validators` a private property that doesn't show up in for/in #6572
550 * docs(api): fix array API docs that vanished because of #7798 #7979
551 * docs(discriminators+api): add single nested discriminator to discriminator docs and API docs #7983
552 * docs(connection+mongoose): make option lists consistent between `mongoose.connect()`, `mongoose.createConnection()`, and `conn.openUri()` #7976
553 * docs(validation): clarify resolve(false) vs reject() for promise-based async custom validators #7761
554 * docs(guide): use correct `mongoose.set()` instead of `mongoose.use()` #7998
555 * docs: add redis cache example #7997 [usama-asfar](https://github.com/usama-asfar)
556
5575.6.5 / 2019-07-17
558==================
559 * fix(document): handle setting non-schema path to ObjectId or Decimal128 if strict: false #7973
560 * fix(connection): remove backwards-breaking multiple mongoose.connect() call for now #7977
561 * fix(schema): print invalid value in error message when a schema path is set to undefined or null #7956
562 * fix(model): throw readable error if calling `new Model.discriminator()` #7957
563 * fix(mongoose): export `cast()` function #7975 [perfectstorm88](https://github.com/perfectstorm88)
564 * docs(model): fix link to Model.inspect() and add example #7990
565 * docs: fix broken anchor links on validation tutorial #7966
566 * docs(api): fix broken links to split API pages #7978
567 * chore: create LICENSE.md #7989 [Fonger](https://github.com/Fonger)
568
5695.6.4 / 2019-07-08
570==================
571 * fix(schema): support pre(Array, Function) and post(Array, Function) #7803
572 * fix(document): load docs with a `once` property successfully #7958
573 * fix(queryhelpers): ensure parent `select` overwrites child path `select` if parent is nested #7945
574 * fix(schema): make `clone()` correctly copy array embedded discriminators #7954
575 * fix(update): fix error when update property gets casted to null #7949
576 * fix(connection): bubble up attemptReconnect event for now #7872
577 * docs(tutorials): add virtuals tutorial #7965
578 * docs(connection): add section on connection handling #6997
579
5805.6.3 / 2019-07-03
581==================
582 * fix(document): respect projection when running getters #7940
583 * fix(model): call createCollection() in syncIndexes() to ensure the collection exists #7931
584 * fix(document): consistently use post-order traversal for gathering subdocs for hooks #7929
585 * fix(schema): ensure `Schema#pathType()` returns correct path type given non-existent positional path #7935
586 * fix(ChangeStream): set `closed` if emitting close event #7930
587 * fix(connection): bubble up 'attemptReconnect' event from MongoDB connection #7872
588 * docs: fix broken .jade links on search page #7932
589 * docs: correct link to `Query#select()` #7953 [rayhatfield](https://github.com/rayhatfield)
590 * docs(README): add list of related projects #7773
591
5924.13.19 / 2019-07-02
593====================
594 * fix(aggregate): make `setOptions()` work as advertised #7950 #6011 [cdimitroulas](https://github.com/cdimitroulas)
595
5965.6.2 / 2019-06-28
597==================
598 * fix(update): allow using `update()` with immutable `createdAt` #7917
599 * fix(model): pass `doc` parameter to save() error handling middleware #7832
600 * fix(mongoose): add applyPluginsToChildSchemas option to allow opting out of global plugins for child schemas #7916
601 * docs(connection): document `useCache` option for `useDb()` #7923
602 * docs: fix broken link in FAQ #7925 [christophergeiger3](https://github.com/christophergeiger3)
603
6045.6.1 / 2019-06-24
605==================
606 * fix(update): skip setting defaults for single embedded subdocs underneath maps #7909
607 * fix(document): copy date objects correctly when strict = false #7907
608 * feat(mongoose): throw an error if calling `mongoose.connect()` multiple times while connected #7905 [Fonger](https://github.com/Fonger)
609 * fix(document): copies virtuals from array subdocs when casting array of docs with same schema #7898
610 * fix(schema): ensure clone() copies single embedded discriminators correctly #7894
611 * fix(discriminator): merge instead of overwriting conflicting nested schemas in discriminator schema #7884
612 * fix(populate): ignore nullish arguments when calling `populate()` #7913 [rayhatfield](https://github.com/rayhatfield)
613 * docs: add getters/setters tutorial #7919
614 * docs: clean up error docs so they refer to `Error` rather than `MongooseError` #7867
615 * docs: fix a couple broken links #7921 [kizmo04](https://github.com/kizmo04)
616 * refactor: remove unnecessary if #7911 [rayhatfield](https://github.com/rayhatfield)
617
6185.6.0 / 2019-06-14
619==================
620 * feat(schematype): add `immutable` option to disallow changing a given field #7671
621 * docs: split API docs into separate pages to make API documentation more Google-able #7812
622 * perf(array): remove all mixins in favor of ES6 classes, ~20% faster in basic benchmarks #7798
623 * feat(document): use promise rejection error message when async custom validator throws an error #4913
624 * feat(virtual): pass document as 3rd parameter to virtual getters and setters to enable using arrow functions #4143
625 * feat(model): add `Model.exists()` function to quickly check whether a document matching `filter` exists #6872
626 * feat(index+connection): support setting global and connection-level `maxTimeMS`
627 * feat(populate): support setting `ref` to a function for conventional populate #7669
628 * feat(document): add overwrite() function that overwrites all values in a document #7830
629 * feat(populate): support `PopulateOptions#connection` option to allow cross-db populate with refPath #6520
630 * feat(populate): add skipInvalidIds option to silently skip population if id is invalid, instead of throwing #7706
631 * feat(array): skip empty array default if there's a 2dsphere index on a geojson path #3233
632 * feat(query): add `getFilter()` as an alias of `getQuery()` to be more in line with API docs #7839
633 * feat(model): add Model.inspect() to make models not clutter `util.inspect()` #7836
634 * perf(discriminator): skip calling `createIndex()` on indexes that are defined in the base schema #7379
635 * docs: upgrade from Jade to latest Pug #7812
636 * docs(README): update reference to example schema.js #7899 [sharils](https://github.com/sharils)
637 * docs(README): improve variable name #7900 [sharils](https://github.com/sharils)
638 * chore: replace charAt(0) with startsWith #7897 [Fonger](https://github.com/Fonger)
639 * chore: replace indexOf with includes, startsWith and endsWith for String #7897 [Fonger](https://github.com/Fonger)
640
6415.5.15 / 2019-06-12
642===================
643 * fix(connection): reject initial connect promise even if there is an on('error') listener #7850
644 * fix(map): make `of` automatically convert POJOs to schemas unless typeKey is set #7859
645 * fix(update): use discriminator schema to cast update if discriminator key specified in filter #7843
646 * fix(array): copy atomics from source array #7891 #7889 [jyrkive](https://github.com/jyrkive)
647 * fix(schema): return this when Schema.prototype.add is called with Schema #7887 [Mickael-van-der-Beek](https://github.com/Mickael-van-der-Beek)
648 * fix(document): add `numAffected` and `result` to DocumentNotFoundError for better debugging #7892 #7844
649
6505.5.14 / 2019-06-08
651===================
652 * fix(query): correct this scope of setters in update query #7876 [Fonger](https://github.com/Fonger)
653 * fix(model): reset modifiedPaths after successful insertMany #7852 #7873 [Fonger](https://github.com/Fonger)
654 * fix(populate): allow using `refPath` with virtual populate #7848
655 * fix(document): prepend private methods getValue and setValue with $ #7870 [Fonger](https://github.com/Fonger)
656 * fix: update mongodb driver -> 3.2.7 #7871 [Fonger](https://github.com/Fonger)
657 * docs(tutorials): add tutorial about custom casting functions #7045
658 * docs(connection): fix outdated events document #7874 [Fonger](https://github.com/Fonger)
659 * docs: fix typo in lean docs #7875 [tannakartikey](https://github.com/tannakartikey)
660 * docs: move off of KeenIO for tracking and use self-hosted analytics instead
661
6625.5.13 / 2019-06-05
663===================
664 * fix(model): support passing deleteOne options #7860 #7857 [Fonger](https://github.com/Fonger)
665 * fix(update): run setters on array elements when doing $addToSet, $push, etc #4185
666 * fix(model): support getting discriminator by value when creating a new model #7851
667 * docs(transactions): add section about the `withTransaction()` helper #7598
668 * docs(schema): clarify relationship between Schema#static() and Schema#statics #7827
669 * docs(model): fix typo `projetion` to `projection` #7868 [dfdeagle47](https://github.com/dfdeagle47)
670 * docs(schema): correct schema options lists #7828
671
6725.5.12 / 2019-05-31
673===================
674 * fix(document): fix unexpected error when loading a document with a nested property named `schema` #7831
675 * fix(model): skip applying static hooks by default if static name conflicts with query middleware (re: mongoose-delete plugin) #7790
676 * fix(query): apply schema-level projections to the result of `findOneAndReplace()` #7654
677 * fix: upgrade mongodb driver -> 3.2.6
678 * docs(tutorials): add findOneAndUpdate() tutorial #7847
679 * docs(validation): add `updateOne()` and `updateMany()` to list of update validator operations #7845
680 * docs(model): make sure options lists in `update()` API line up #7842
681
6825.5.11 / 2019-05-23
683===================
684 * fix(discriminator): allow numeric discriminator keys for embedded discriminators #7808
685 * chore: add Node.js 12 to travis build matrix #7784
686
6875.5.10 / 2019-05-20
688===================
689 * fix(discriminator): allow user-defined discriminator path in schema #7807
690 * fix(query): ensure `findOneAndReplace()` sends `replacement` to server #7654
691 * fix(cast): allow `[]` as a value when casting `$nin` #7806
692 * docs(model): clarify that setters do run on `update()` by default #7801
693 * docs: fix typo in FAQ #7821 [jaona](https://github.com/jaona)
694
6955.5.9 / 2019-05-16
696==================
697 * fix(query): skip schema setters when casting $regexp $options #7802 [Fonger](https://github.com/Fonger)
698 * fix(populate): don't skip populating doc array properties whose name conflicts with an array method #7782
699 * fix(populate): make populated virtual return undefined if not populated #7795
700 * fix(schema): handle custom setters in arrays of document arrays #7804 [Fonger](https://github.com/Fonger)
701 * docs(tutorials): add query casting tutorial #7789
702
7035.5.8 / 2019-05-13
704==================
705 * fix(document): run pre save hooks on nested child schemas #7792
706 * fix(model): set $session() before validation middleware for bulkWrite/insertMany #7785 #7769 [Fonger](https://github.com/Fonger)
707 * fix(query): make `getPopulatedPaths()` return deeply populated paths #7757
708 * fix(query): suppress findAndModify deprecation warning when using `Model.findOneAndUpdate()` #7794
709 * fix: upgrade mongodb -> 3.2.4 #7794
710 * fix(document): handle a couple edge cases with atomics that happen when schema defines an array property named 'undefined' #7756
711 * docs(discriminator): correct function parameters #7786 [gfpacheco](https://github.com/gfpacheco)
712
7135.5.7 / 2019-05-09
714==================
715 * fix(model): set $session() before pre save middleware runs when calling save() with options #7742
716 * fix(model): set $session before pre remove hooks run when calling remove() with options #7742
717 * fix(schema): support `remove()` on nested path #2398
718 * fix(map): handle setting populated map element to doc #7745
719 * fix(query): return rawResult when inserting with options `{new:false,upsert:true,rawResult:true}` #7774 #7770 [LiaanM](https://github.com/LiaanM)
720 * fix(schematype): remove internal `validators` option because it conflicts with Backbone #7720
721
7225.5.6 / 2019-05-06
723==================
724 * fix(document): stop converting arrays to objects when setting non-schema path to array with strict: false #7733
725 * fix(array): make two Mongoose arrays `assert.deepEqual()` each other if they have the same values #7700
726 * fix(populate): support populating a path in a document array embedded in an array #7647
727 * fix(populate): set populate virtual count to 0 if local field is empty #7731
728 * fix(update): avoid throwing cast error if casting array filter that isn't in schema with strictQuery = false #7728
729 * docs: fix typo in `distinct()` description #7767 [phil-r](https://github.com/phil-r)
730
7315.5.5 / 2019-04-30
732==================
733 * fix(document): ensure nested properties within single nested subdocs get set correctly when overwriting single nested subdoc #7748
734 * fix(document): skip non-object `validators` in schema types #7720
735 * fix: bump mongodb driver -> 3.2.3 #7752
736 * fix(map): disallow setting map key with special properties #7750 [Fonger](https://github.com/Fonger)
737
7385.5.4 / 2019-04-25
739==================
740 * fix(document): avoid calling custom getters when saving #7719
741 * fix(timestamps): handle child schema timestamps correctly when reusing child schemas #7712
742 * fix(query): pass correct callback for _legacyFindAndModify #7736 [Fonger](https://github.com/Fonger)
743 * fix(model+query): allow setting `replacement` parameter for `findOneAndReplace()` #7654
744 * fix(map): make `delete()` unset the key in the database #7746 [Fonger](https://github.com/Fonger)
745 * fix(array): use symbol for `_schema` property to avoid confusing deep equality checks #7700
746 * fix(document): prevent `depopulate()` from removing fields with empty array #7741 #7740 [Fonger](https://github.com/Fonger)
747 * fix: make `MongooseArray#includes` support ObjectIds #7732 #6354 [hansemannn](https://github.com/hansemannn)
748 * fix(document): report correct validation error index when pushing onto doc array #7744 [Fonger](https://github.com/Fonger)
749
7505.5.3 / 2019-04-22
751==================
752 * fix: add findAndModify deprecation warning that references the useFindAndModify option #7644
753 * fix(document): handle pushing a doc onto a discriminator that contains a doc array #7704
754 * fix(update): run setters on array elements when doing $set #7679
755 * fix: correct usage of arguments while buffering commands #7718 [rzymek](https://github.com/rzymek)
756 * fix(document): avoid error clearing modified subpaths if doc not defined #7715 [bitflower](https://github.com/bitflower)
757 * refactor(array): move `_parent` property behind a symbol #7726 #7700
758 * docs(model): list out all operations and options for `bulkWrite()` #7055
759 * docs(aggregate): use `eachAsync()` instead of nonexistent `each()` #7699
760 * docs(validation): add CastError validation example #7514
761 * docs(query+model): list out all options and callback details for Model.updateX() and Query#updateX() #7646
762
7635.5.2 / 2019-04-16
764==================
765 * fix(document): support setting nested path to non-POJO object #7639
766 * perf(connection): remove leaked event handler in `Model.init()` so `deleteModel()` frees all memory #7682
767 * fix(timestamps): handle custom statics that conflict with built-in functions (like mongoose-delete plugin) #7698
768 * fix(populate): make `Document#populated()` work for populated subdocs #7685
769 * fix(document): support `.set()` on document array underneath embedded discriminator path #7656
770
7715.5.1 / 2019-04-11
772==================
773 * fix(document): correctly overwrite all properties when setting a single nested subdoc #7660 #7681
774 * fix(array): allow customization of array required validator #7696 [freewil](https://github.com/freewil)
775 * fix(discriminator): handle embedded discriminators when casting array defaults #7687
776 * fix(collection): ensure collection functions return a promise even if disconnected #7676
777 * fix(schematype): avoid indexing properties with `{ unique: false, index: false }` #7620
778 * fix(aggregate): make `Aggregate#model()` with no arguments return the aggregation's model #7608
779
7805.5.0 / 2019-04-08
781==================
782 * feat(model): support applying hooks to custom static functions #5982
783 * feat(populate): support specifying a function as `match` #7397
784 * perf(buffer): avoid calling `defineProperties()` in Buffer constructor #7331
785 * feat(connection): add `plugin()` for connection-scoped plugins #7378
786 * feat(model): add Model#deleteOne() and corresponding hooks #7538
787 * feat(query): support hooks for `Query#distinct()` #5938
788 * feat(model): print warning when calling create() incorrectly with a session #7535
789 * feat(document): add Document#isEmpty() and corresponding helpers for nested paths #5369
790 * feat(document): add `getters` option to Document#get() #7233
791 * feat(query): add Query#projection() to get or overwrite the current projection #7384
792 * fix(document): set full validator path on validatorProperties if `propsParameter` set on validator #7447
793 * feat(document): add Document#directModifiedPaths() #7373
794 * feat(document): add $locals property #7691
795 * feat(document): add validateUpdatedOnly option that only validates modified paths in `save()` #7492 [captaincaius](https://github.com/captaincaius)
796 * chore: upgrade MongoDB driver to v3.2.0 #7641
797 * fix(schematype): deprecate `isAsync` option for custom validators #6700
798 * chore(mongoose): deprecate global.MONGOOSE_DRIVER_PATH so we can be webpack-warning-free in 6.0 #7501
799
8005.4.23 / 2019-04-08
801===================
802 * fix(document): report cast error when string path in schema is an array in MongoDB #7619
803 * fix(query): set deletedCount on result of remove() #7629
804 * docs(subdocs): add note about parent() and ownerDocument() to subdocument docs #7576
805
8065.4.22 / 2019-04-04
807===================
808 * fix(aggregate): allow modifying options in pre('aggregate') hook #7606
809 * fix(map): correctly init maps of maps when loading from MongoDB #7630
810 * docs(model+query): add `omitUndefined` option to docs for updateX() and findOneAndX() #3486
811 * docs: removed duplicate Query.prototype.merge() reference from doc #7684 [shihabmridha](https://github.com/shihabmridha)
812 * docs(schema): fix shardKey type to object instead of bool #7668 [kyletsang](https://github.com/kyletsang)
813 * docs(api): fix `Model.prototypedelete` link #7665 [pixcai](https://github.com/pixcai)
814
8155.4.21 / 2019-04-02
816===================
817 * fix(updateValidators): run update validators correctly on Decimal128 paths #7561
818 * fix(update): cast array filters in nested doc arrays correctly #7603
819 * fix(document): allow .get() + .set() with aliased paths #7592
820 * fix(document): ensure custom getters on single nested subdocs don't get persisted if toObject.getters = true #7601
821 * fix(document): support setting subdoc path to subdoc copied using object rest `{...doc}` #7645
822 * docs(schema): correct out-of-date list of reserved words #7593
823 * docs(model+query): add link to update results docs and examples of using results of updateOne(), etc. #7582
824 * docs: use atomic as opposed to $atomic consistently #7649 [720degreeLotus](https://github.com/720degreeLotus)
825
8265.4.20 / 2019-03-25
827===================
828 * docs(tutorials): add tutorial about `lean()` #7640
829 * fix(discriminator): fix wrong modelName being used as value to partialFilterExpression index #7635 #7634 [egorovli](https://github.com/egorovli)
830 * fix(document): allow setters to modify `this` when overwriting single nested subdoc #7585
831 * fix(populate): handle count option correctly with multiple docs #7573
832 * fix(date): support declaring min/max validators as functions #7600 [ChienDevIT](https://github.com/ChienDevIT)
833 * fix(discriminator): avoid projecting in embedded discriminator if only auto-selected path is discriminator key #7574
834 * fix(discriminator): use discriminator model when using `new BaseModel()` with discriminator key #7586
835 * fix(timestamps): avoid throwing if doc array has timestamps and array is undefined #7625 [serg33v](https://github.com/serg33v)
836 * docs(document): explain DocumentNotFoundError in save() docs #7580
837 * docs(query): fix .all() param type and add example #7612 [720degreeLotus](https://github.com/720degreeLotus)
838 * docs: add useNewUrlParser to mongoose.connect for some pages #7615 [YC](https://github.com/YC)
839
8405.4.19 / 2019-03-11
841===================
842 * fix(mongoose): ensure virtuals set on subdocs in global plugins get applied #7572
843 * docs(tutorials): add "Working With Dates" tutorial #7597
844 * docs(guide): clarify that versioning only affects array fields #7555
845 * docs(model): list out all bulkWrite() options #7550
846
8475.4.18 / 2019-03-08
848===================
849 * fix(document): handle nested virtuals in populated docs when parent path is projected out #7491
850 * fix(model): make subclassed models handle discriminators correctly #7547
851 * fix(model): remove $versionError from save options for better debug output #7570
852
8535.4.17 / 2019-03-03
854===================
855 * fix(update): handle all positional operator when casting array filters #7540
856 * fix(populate): handle populating nested path where top-level path is a primitive in the db #7545
857 * fix(update): run update validators on array filters #7536
858 * fix(document): clean modified subpaths when sorting an array #7556
859 * fix(model): cast $setOnInsert correctly with nested docs #7534
860 * docs: remove extra curly brace from example #7569 [kolya182](https://github.com/kolya182)
861
8625.4.16 / 2019-02-26
863===================
864 * fix(schema): handle nested objects with `_id: false` #7524
865 * fix(schema): don't throw error if declaring a virtual that starts with a map path name #7464
866 * fix(browser): add stubbed `model()` function so code that uses model doesn't throw #7541 [caub](https://github.com/caub)
867 * fix(schema): merge virtuals correctly #7563 [yoursdearboy](https://github.com/yoursdearboy)
868 * docs(connections): add reconnectFailed to connection docs #7477
869 * docs(index): fix typo #7553 [DenrizSusam](https://github.com/DenrizSusam)
870 * refactor(schema): iterate over paths instead of depending on childSchemas #7554
871
8725.4.15 / 2019-02-22
873===================
874 * fix(update): don't call schematype validators on array if using $pull with runValidators #6971
875 * fix(schema): clone all schema types when cloning an array #7537
876 * docs(connections): improve connectTimeoutMS docs and socketTimeoutMS docs to link to Node.js net.setTimeout() #5169
877 * docs: fix setters example in migration guide #7546 [freewil](https://github.com/freewil)
878
8795.4.14 / 2019-02-19
880===================
881 * fix(populate): make `getters` option handle nested paths #7521
882 * fix(documentarray): report validation errors that occur in an array subdoc created using `create()` and then `set()` #7504
883 * docs(schema): add examples for schema functions that didn't have any #7525
884 * docs: add MongooseError to API docs and add list of error names
885 * docs(CONTRIBUTING): fix link #7530 [sarpik](https://github.com/sarpik)
886
8875.4.13 / 2019-02-15
888===================
889 * fix(query): throw handy error when using updateOne() with overwrite: true and no dollar keys #7475
890 * fix(schema): support inheriting existing schema types using Node.js `util.inherits` like mongoose-float #7486
891 * docs(connections): add list of connection events #7477
892
8935.4.12 / 2019-02-13
894===================
895 * fix(connection): dont emit reconnected due to socketTimeoutMS #7452
896 * fix(schema): revert check for `false` schema paths #7516 #7512
897 * fix(model): don't delete unaliased keys in translateAliases #7510 [chrischen](https://github.com/chrischen)
898 * fix(document): run single nested schematype validator if nested path has a default and subpath is modified #7493
899 * fix(query): copy mongoose options when using `Query#merge()` #1790
900 * fix(timestamps): don't call createdAt getters when setting updatedAt on new doc #7496
901 * docs: improve description of ValidationError #7515 [JulioJu](https://github.com/JulioJu)
902 * docs: add an asterisk before comment, otherwise the comment line is not generated #7513 [JulioJu](https://github.com/JulioJu)
903
9045.4.11 / 2019-02-09
905===================
906 * fix(schema): handle `_id: false` in schema paths as a shortcut for setting the `_id` option to `false` #7480
907 * fix(update): handle $addToSet and $push with ObjectIds and castNonArrays=false #7479
908 * docs(model): document `session` option to `save()` #7484
909 * chore: fix gitignore syntax #7498 [JulioJu](https://github.com/JulioJu)
910 * docs: document that Document#validateSync returns ValidationError #7499
911 * refactor: use consolidated `isPOJO()` function instead of constructor checks #7500
912
9135.4.10 / 2019-02-05
914===================
915 * docs: add search bar and /search page #6706
916 * fix: support dotted aliases #7478 [chrischen](https://github.com/chrischen)
917 * fix(document): copy atomics when setting document array to an existing document array #7472
918 * chore: upgrade to mongodb driver 3.1.13 #7488
919 * docs: remove confusing references to executing a query "immediately" #7461
920 * docs(guides+schematypes): link to custom schematypes docs #7407
921
9225.4.9 / 2019-02-01
923==================
924 * fix(document): make `remove()`, `updateOne()`, and `update()` use the document's associated session #7455
925 * fix(document): support passing args to hooked custom methods #7456
926 * fix(document): avoid double calling single nested getters on `toObject()` #7442
927 * fix(discriminator): handle global plugins modifying top-level discriminator options with applyPluginsToDiscriminators: true #7458
928 * docs(documents): improve explanation of documents and use more modern syntax #7463
929 * docs(middleware+api): fix a couple typos in examples #7474 [arniu](https://github.com/arniu)
930
9315.4.8 / 2019-01-30
932==================
933 * fix(query): fix unhandled error when casting object in array filters #7431
934 * fix(query): cast query $elemMatch to discriminator schema if discriminator key set #7449
935 * docs: add table of contents to all guides #7430
936
9375.4.7 / 2019-01-26
938==================
939 * fix(populate): set `populated()` when using virtual populate #7440
940 * fix(discriminator): defer applying plugins to embedded discriminators until model compilation so global plugins work #7435
941 * fix(schema): report correct pathtype underneath map so setting dotted paths underneath maps works #7448
942 * fix: get debug from options using the get helper #7451 #7446 [LucGranato](https://github.com/LucGranato)
943 * fix: use correct variable name #7443 [esben-semmle](https://github.com/esben-semmle)
944 * docs: fix broken QueryCursor link #7438 [shihabmridha](https://github.com/shihabmridha)
945
9465.4.6 / 2019-01-22
947==================
948 * fix(utils): make minimize leave empty objects in arrays instead of setting the array element to undefined #7322
949 * fix(document): support passing `{document, query}` options to Schema#pre(regex) and Schema#post(regex) #7423
950 * docs: add migrating to 5 guide to docs #7434
951 * docs(deprecations): add instructions for fixing `count()` deprecation #7419
952 * docs(middleware): add description and example for aggregate hooks #7402
953
9544.13.18 / 2019-01-21
955====================
956 * fix(model): handle setting populated path set via `Document#populate()` #7302
957 * fix(cast): backport fix from #7290 to 4.x
958
9595.4.5 / 2019-01-18
960==================
961 * fix(populate): handle nested array `foreignField` with virtual populate #7374
962 * fix(query): support not passing any arguments to `orFail()` #7409
963 * docs(query): document what the resolved value for `deleteOne()`, `deleteMany()`, and `remove()` contains #7324
964 * fix(array): allow opting out of converting non-arrays into arrays with `castNonArrays` option #7371
965 * fix(query): ensure updateOne() doesnt unintentionally double call Schema#post(regexp) #7418
966
9675.4.4 / 2019-01-14
968==================
969 * fix(query): run casting on arrayFilters option #7079
970 * fix(document): support skipping timestamps on save() with `save({ timestamps: false })` #7357
971 * fix(model): apply custom where on `Document#remove()` so we attach the shardKey #7393
972 * docs(mongoose): document `mongoose.connections` #7338
973
9745.4.3 / 2019-01-09
975==================
976 * fix(populate): handle `count` option when using `Document#populate()` on a virtual #7380
977 * fix(connection): set connection state to DISCONNECTED if replica set has no primary #7330
978 * fix(mongoose): apply global plugins to schemas nested underneath embedded discriminators #7370
979 * fix(document): make modifiedPaths() return nested paths 1 level down on initial set #7313
980 * fix(plugins): ensure sharding plugin works even if ObjectId has a `valueOf()` #7353
981
9825.4.2 / 2019-01-03
983==================
984 * fix(document): ensure Document#updateOne() returns a query but still calls hooks #7366
985 * fix(query): allow explicitly projecting out populated paths that are automatically projected in #7383
986 * fix(document): support setting `flattenMaps` option for `toObject()` and `toJSON()` at schema level #7274
987 * fix(query): handle merging objectids with `.where()` #7360
988 * fix(schema): copy `.base` when cloning #7377
989 * docs: remove links to plugins.mongoosejs.com in favor of plugins.mongoosejs.io #7364
990
9915.4.1 / 2018-12-26
992==================
993 * fix(document): ensure doc array defaults get casted #7337
994 * fix(document): make `save()` not crash if nested doc has a property 'get' #7316
995 * fix(schema): allow using Schema.Types.Map as well as Map to declare a map type #7305
996 * fix(map): make set after init mark correct path as modified #7321
997 * fix(mongoose): don't recompile model if same collection and schema passed in to `mongoose.model()` #5767
998 * fix(schema): improve error message when type is invalid #7303
999 * fix(schema): add `populated` to reserved property names #7317
1000 * fix(model): don't run built-in middleware on custom methods and ensure timestamp hooks don't run if children don't have timestamps set #7342
1001 * docs(schematypes): clarify that you can add arbitrary options to a SchemaType #7340
1002 * docs(mongoose): clarify that passing same name+schema to `mongoose.model()` returns the model #5767
1003 * docs(index): add useNewUrlParser to example #7368 [JIBIN-P](https://github.com/JIBIN-P)
1004 * docs(connection): add useNewUrlParser to examples #7362 [JIBIN-P](https://github.com/JIBIN-P)
1005 * docs(discriminators): add back missing example from 'recursive embedded discriminators section' #7349
1006 * docs(schema): improve docs for string and boolean cast() #7351
1007
10085.4.0 / 2018-12-14
1009==================
1010 * feat(schematype): add `SchemaType.get()`, custom getters across all instances of a schematype #6912
1011 * feat(schematype): add `SchemaType.cast()`, configure casting for individual schematypes #7045
1012 * feat(schematype): add `SchemaType.checkRequired()`, configure what values pass `required` check for a schematype #7186 #7150
1013 * feat(model): add `Model.findOneAndReplace()` #7162
1014 * feat(model): add `Model.events` emitter that emits all `error`'s that occur with a given model #7125
1015 * feat(populate): add `count` option to populate virtuals, support returning # of populated docs instead of docs themselves #4469
1016 * feat(aggregate): add `.catch()` helper to make aggregations full thenables #7267
1017 * feat(query): add hooks for `deleteOne()` and `deleteMany()` #7195
1018 * feat(document): add hooks for `updateOne()` #7133
1019 * feat(query): add `Query#map()` for synchronously transforming results before post middleware runs #7142
1020 * feat(schema): support passing an array of objects or schemas to `Schema` constructor #7218
1021 * feat(populate): add `clone` option to ensure multiple docs don't share the same populated doc #3258
1022 * feat(query): add `Query#maxTimeMS()` helper #7254
1023 * fix(query): deprecate broken `Aggregate#addCursorFlag()` #7120
1024 * docs(populate): fix incorrect example #7335 [zcfan](https://github.com/zcfan)
1025 * docs(middleware): add `findOneAndDelete` to middleware list #7327 [danielkesselberg](https://github.com/danielkesselberg)
1026
10275.3.16 / 2018-12-11
1028===================
1029 * fix(document): handle `__proto__` in queries #7290
1030 * fix(document): use Array.isArray() instead of checking constructor name for arrays #7290
1031 * docs(populate): add section about what happens when no document matches #7279
1032 * fix(mongoose): avoid crash on `import mongoose, {Schema} from 'mongoose'` #5648
1033
10345.3.15 / 2018-12-05
1035===================
1036 * fix(query): handle `orFail()` with `findOneAndUpdate()` and `findOneAndDelete()` #7297 #7280
1037 * fix(document): make `save()` succeed if strict: false with a `collection` property #7276
1038 * fix(document): add `flattenMaps` option for toObject() #7274
1039 * docs(document): document flattenMaps option #7274
1040 * fix(populate): support populating individual subdoc path in document array #7273
1041 * fix(populate): ensure `model` option overrides `refPath` #7273
1042 * fix(map): don't call subdoc setters on init #7272
1043 * fix(document): use internal get() helper instead of lodash.get to support `null` projection param #7271
1044 * fix(document): continue running validateSync() for all elements in doc array after first error #6746
1045
10465.3.14 / 2018-11-27
1047===================
1048 * docs(api): use `openUri()` instead of legacy `open()` #7277 [artemjackson](https://github.com/artemjackson)
1049 * fix(document): don't mark date underneath single nested as modified if setting to string #7264
1050 * fix(update): set timestamps on subdocs if not using $set with no overwrite #7261
1051 * fix(document): use symbol instead of `__parent` so user code doesn't conflict #7230
1052 * fix(mongoose): allow using `mongoose.model()` without context, like `import {model} from 'mongoose'` #3768
1053
10545.3.13 / 2018-11-20
1055===================
1056 * fix: bump mongodb driver -> 3.1.10 #7266
1057 * fix(populate): support setting a model as a `ref` #7253
1058 * docs(schematype): add ref() function to document what is a valid `ref` path in a schematype #7253
1059 * fix(array): clean modified subpaths when calling `splice()` #7249
1060 * docs(compatibility): don't show Mongoose 4.11 as compatible with MongoDB 3.6 re: MongoDB's official compatibility table #7248 [a-harrison](https://github.com/a-harrison)
1061 * fix(document): report correct validation error if doc array set to primitive #7242
1062 * fix(mongoose): print warning when including server-side lib with jest jsdom environment #7240
1063
10645.3.12 / 2018-11-13
1065===================
1066 * docs(compatibility): don't show Mongoose 4.11 as compatible with MongoDB 3.6 re: MongoDB's official compatibility table #7238 [a-harrison](https://github.com/a-harrison)
1067 * fix(populate): use `instanceof` rather than class name for comparison #7237 [ivanseidel](https://github.com/ivanseidel)
1068 * docs(api): make options show up as a nested list #7232
1069 * fix(document): don't mark array as modified on init if doc array has default #7227
1070 * docs(api): link to bulk write result object in `bulkWrite()` docs #7225
1071
10725.3.11 / 2018-11-09
1073===================
1074 * fix(model): make parent pointers non-enumerable so they don't crash JSON.stringify() #7220
1075 * fix(document): allow saving docs with nested props with '.' using `checkKeys: false` #7144
1076 * docs(lambda): use async/await with lambda example #7019
1077
10785.3.10 / 2018-11-06
1079===================
1080 * fix(discriminator): support reusing a schema for multiple discriminators #7200
1081 * fix(cursor): handle `lean(false)` correctly with query cursors #7197
1082 * fix(document): avoid manual populate if `ref` not set #7193
1083 * fix(schema): handle schema without `.base` for browser build #7170
1084 * docs: add further reading section
1085
10865.3.9 / 2018-11-02
1087==================
1088 * fix: upgrade bson dep -> 1.1.0 to match mongodb-core #7213 [NewEraCracker](https://github.com/NewEraCracker)
1089 * docs(api): fix broken anchor link #7210 [gfranco93](https://github.com/gfranco93)
1090 * fix: don't set parent timestamps because a child has timestamps set to false #7203 #7202 [lineus](https://github.com/lineus)
1091 * fix(document): run setter only once when doing `.set()` underneath a single nested subdoc #7196
1092 * fix(document): surface errors in subdoc pre validate #7187
1093 * fix(query): run default functions after hydrating the loaded document #7182
1094 * fix(query): handle strictQuery: 'throw' with nested path correctly #7178
1095 * fix(update): update timestamps on replaceOne() #7152
1096 * docs(transactions): add example of aborting a transaction #7113
1097
10985.3.8 / 2018-10-30
1099==================
1100 * fix: bump mongodb driver -> 3.1.8 to fix connecting to +srv uri with no credentials #7191 #6881 [lineus](https://github.com/lineus)
1101 * fix(document): sets defaults correctly in child docs with projection #7159
1102 * fix(mongoose): handle setting custom type on a separate mongoose global #7158
1103 * fix: add unnecessary files to npmignore #7157
1104 * fix(model): set session when creating new subdoc #7104
1105
11065.3.7 / 2018-10-26
1107==================
1108 * fix(browser): fix buffer usage in browser build #7184 #7173 [lineus](https://github.com/lineus)
1109 * fix(document): make depopulate() work on populate virtuals and unpopulated docs #7180 #6075 [lineus](https://github.com/lineus)
1110 * fix(document): only pass properties as 2nd arg to custom validator if `propsParameter` set #7145
1111 * docs(schematypes): add note about nested paths with `type` getting converted to mixed #7143
1112 * fix(update): run update validators on nested doc when $set on an array #7135
1113 * fix(update): copy exact errors from array subdoc validation into top-level update validator error #7135
1114
11155.3.6 / 2018-10-23
1116==================
1117 * fix(cursor): fix undefined transforms error
1118
11195.3.5 / 2018-10-22
1120==================
1121 * fix(model): make sure versionKey on `replaceOne()` always gets set at top level to prevent cast errors #7138
1122 * fix(cursor): handle non-boolean lean option in `eachAsync()` #7137
1123 * fix(update): correct cast update that overwrites a map #7111
1124 * fix(schema): handle arrays of mixed correctly #7109
1125 * fix(query): use correct path when getting schema for child timestamp update #7106
1126 * fix(document): make `$session()` propagate sessions to child docs #7104
1127 * fix(document): handle user setting `schema.options.strict = 'throw'` #7103
1128 * fix(types): use core Node.js buffer prototype instead of safe-buffer because safe-buffer is broken for Node.js 4.x #7102
1129 * fix(document): handle setting single doc with refPath to document #7070
1130 * fix(model): handle array filters when updating timestamps for subdocs #7032
1131
11325.3.4 / 2018-10-15
1133==================
1134 * fix(schema): make `add()` and `remove()` return the schema instance #7131 [lineus](https://github.com/lineus)
1135 * fix(query): don't require passing model to `cast()` #7118
1136 * fix: support `useFindAndModify` as a connection-level option #7110 [lineus](https://github.com/lineus)
1137 * fix(populate): handle plus path projection with virtual populate #7050
1138 * fix(schema): allow using ObjectId type as schema path type #7049
1139 * docs(schematypes): elaborate on how schematypes relate to types #7049
1140 * docs(deprecations): add note about gridstore deprecation #6922
1141 * docs(guide): add storeSubdocValidationError option to guide #6802
1142
11435.3.3 / 2018-10-12
1144==================
1145 * fix(document): enable storing mongoose validation error in MongoDB by removing `$isValidatorError` property #7127
1146 * docs(api): clarify that aggregate triggers aggregate middleware #7126 [lineus](https://github.com/lineus)
1147 * fix(connection): handle Model.init() when an index exists on schema + autoCreate == true #7122 [jesstelford](https://github.com/jesstelford)
1148 * docs(middleware): explain how to switch between document and query hooks for `remove()` #7093
1149 * docs(api): clean up encoding issues in SchemaType.prototype.validate docs #7091
1150 * docs(schema): add schema types to api docs and update links on schematypes page #7080 #7076 [lineus](https://github.com/lineus)
1151 * docs(model): expand model constructor docs with examples and `fields` param #7077
1152 * docs(aggregate): remove incorrect description of noCursorTimeout and add description of aggregate options #7056
1153 * docs: re-add array type to API docs #7027
1154 * docs(connections): add note about `members.host` errors due to bad host names in replica set #7006
1155
11565.3.2 / 2018-10-07
1157==================
1158 * fix(query): make sure to return correct result from `orFail()` #7101 #7099 [gsandorx](https://github.com/gsandorx)
1159 * fix(schema): handle `{ timestamps: false }` correctly #7088 #7074 [lineus](https://github.com/lineus)
1160 * docs: fix markdown in options.useCreateIndex documentation #7085 [Cyral](https://github.com/Cyral)
1161 * docs(schema): correct field name in timestamps example #7082 [kizmo04](https://github.com/kizmo04)
1162 * docs(migrating_to_5): correct markdown syntax #7078 [gwuah](https://github.com/gwuah)
1163 * fix(connection): add useFindAndModify option in connect #7059 [NormanPerrin](https://github.com/NormanPerrin)
1164 * fix(document): dont mark single nested path as modified if setting to the same value #7048
1165 * fix(populate): use WeakMap to track lean populate models rather than leanPopulateSymbol #7026
1166 * fix(mongoose): avoid unhandled rejection when `mongoose.connect()` errors with a callback #6997
1167 * fix(mongoose): isolate Schema.Types between custom Mongoose instances #6933
1168
11695.3.1 / 2018-10-02
1170==================
1171 * fix(ChangeStream): expose driver's `close()` function #7068 #7022 [lineus](https://github.com/lineus)
1172 * fix(model): avoid printing warning if `_id` index is set to "hashed" #7053
1173 * fix(populate): handle nested populate underneath lean array correctly #7052
1174 * fix(update): make timestamps not crash on a null or undefined update #7041
1175 * docs(schematypes+validation): clean up links from validation docs to schematypes docs #7040
1176 * fix(model): apply timestamps to nested docs in bulkWrite() #7032
1177 * docs(populate): rewrite refPath docs to be simpler and more direct #7013
1178 * docs(faq): explain why destructuring imports are not supported in FAQ #7009
1179
11805.3.0 / 2018-09-28
1181==================
1182 * feat(mongoose): support `mongoose.set('debug', WritableStream)` so you can pipe debug to stderr, file, or network #7018
1183 * feat(query): add useNestedStrict option #6973 #5144 [lineus](https://github.com/lineus)
1184 * feat(query): add getPopulatedPaths helper to Query.prototype #6970 #6677 [lineus](https://github.com/lineus)
1185 * feat(model): add `createCollection()` helper to make transactions easier #6948 #6711 [Fonger](https://github.com/Fonger)
1186 * feat(schema): add ability to do `schema.add(otherSchema)` to merge hooks, virtuals, etc. #6897
1187 * feat(query): add `orFail()` helper that throws an error if no documents match `filter` #6841
1188 * feat(mongoose): support global toObject and toJSON #6815
1189 * feat(connection): add deleteModel() to remove a model from a connection #6813
1190 * feat(mongoose): add top-level mongoose.ObjectId, mongoose.Decimal128 for easier schema declarations #6760
1191 * feat(aggregate+query): support for/await/of (async iterators) #6737
1192 * feat(mongoose): add global `now()` function that you can stub for testing timestamps #6728
1193 * feat(schema): support `schema.pre(RegExp, fn)` and `schema.post(RegExp, fn)` #6680
1194 * docs(query): add better docs for the `mongooseOptions()` function #6677
1195 * feat(mongoose): add support for global strict object #6858
1196 * feat(schema+mongoose): add autoCreate option to automatically create collections #6489
1197 * feat(update): update timestamps on nested subdocs when using `$set` #4412
1198 * feat(query+schema): add query `remove` hook and ability to switch between query `remove` and document `remove` middleware #3054
1199
12005.2.18 / 2018-09-27
1201===================
1202 * docs(migrating_to_5): add note about overwriting filter properties #7030
1203 * fix(query): correctly handle `select('+c')` if c is not in schema #7017
1204 * fix(document): check path exists before checking for required #6974
1205 * fix(document): retain user-defined key order on initial set with nested docs #6944
1206 * fix(populate): handle multiple localFields + foreignFields using `localField: function() {}` syntax #5704
1207
12085.2.17 / 2018-09-21
1209===================
1210 * docs(guide): clarify that Mongoose only increments versionKey on `save()` and add a workaround for `findOneAndUpdate()` #7038
1211 * fix(model): correctly handle `createIndex` option to `ensureIndexes()` #7036 #6922 [lineus](https://github.com/lineus)
1212 * docs(migrating_to_5): add a note about changing debug output from stderr to stdout #7034 #7018 [lineus](https://github.com/lineus)
1213 * fix(query): add `setUpdate()` to allow overwriting update without changing op #7024 #7012 [lineus](https://github.com/lineus)
1214 * fix(update): find top-level version key even if there are `$` operators in the update #7003
1215 * docs(model+query): explain which operators `count()` supports that `countDocuments()` doesn't #6911
1216
12175.2.16 / 2018-09-19
1218===================
1219 * fix(index): use dynamic require only when needed for better webpack support #7014 #7010 [jaydp17](https://github.com/jaydp17)
1220 * fix(map): handle arrays of mixed maps #6995
1221 * fix(populate): leave justOne as null if populating underneath a Mixed type #6985
1222 * fix(populate): add justOne option to allow overriding any bugs with justOne #6985
1223 * fix(query): add option to skip adding timestamps to an update #6980
1224 * docs(model+schematype): improve docs about background indexes and init() #6966
1225 * fix: bump mongodb -> 3.1.6 to allow connecting to srv url without credentials #6955 #6881 [lineus](https://github.com/lineus)
1226 * fix(connection): allow specifying `useCreateIndex` at the connection level, overrides global-level #6922
1227 * fix(schema): throw a helpful error if setting `ref` to an invalid value #6915
1228
12295.2.15 / 2018-09-15
1230===================
1231 * fix(populate): handle virtual justOne correctly if it isn't set #6988
1232 * fix(populate): consistently use lowercase `model` instead of `Model` so double-populating works with existing docs #6978
1233 * fix(model): allow calling `Model.init()` again after calling `dropDatabase()` #6967
1234 * fix(populate): find correct justOne when double-populating underneath an array #6798
1235 * docs(webpack): make webpack docs use es2015 preset for correct libs and use acorn to test output is valid ES5 #6740
1236 * fix(populate): add selectPopulatedPaths option to opt out of auto-adding `populate()`-ed fields to `select()` #6546
1237 * fix(model): set timestamps on bulkWrite `insertOne` and `replaceOne` #5708
1238
12395.2.14 / 2018-09-09
1240===================
1241 * docs: fix wording on promise docs to not imply queries only return promises #6983 #6982 [lineus](https://github.com/lineus)
1242 * fix(map): throw TypeError if keys are not string #6956
1243 * fix(document): ensure you can `validate()` a child doc #6931
1244 * fix(populate): avoid cast error if refPath points to localFields with 2 different types #6870
1245 * fix(populate): handle populating already-populated paths #6839
1246 * fix(schematype): make ObjectIds handle refPaths when checking required #6714
1247 * fix(model): set timestamps on bulkWrite() updates #5708
1248
12495.2.13 / 2018-09-04
1250===================
1251 * fix(map): throw TypeError if keys are not string #6968 [Fonger](https://github.com/Fonger)
1252 * fix(update): make array op casting work with strict:false and {} #6962 #6952 [lineus](https://github.com/lineus)
1253 * fix(document): add doc.deleteOne(), doc.updateOne(), doc.replaceOne() re: deprecation warnings #6959 #6940 [lineus](https://github.com/lineus)
1254 * docs(faq+schematypes): add note about map keys needing to be strings #6957 #6956 [lineus](https://github.com/lineus)
1255 * fix(schematype): remove unused if statement #6950 #6949 [cacothi](https://github.com/cacothi)
1256 * docs: add /docs/deprecations.html for dealing with MongoDB driver deprecation warnings #6922
1257 * fix(populate): handle refPath where first element in array has no refPath #6913
1258 * fix(mongoose): allow setting useCreateIndex option after creating a model but before initial connection succeeds #6890
1259 * fix(updateValidators): ensure $pull validators always get an array #6889
1260
12615.2.12 / 2018-08-30
1262===================
1263 * fix(document): disallow setting `constructor` and `prototype` if strict mode false
1264
12654.13.17 / 2018-08-30
1266====================
1267 * fix(document): disallow setting `constructor` and `prototype` if strict mode false
1268
12695.2.11 / 2018-08-30
1270===================
1271 * fix(document): disallow setting __proto__ if strict mode false
1272 * fix(document): run document middleware on docs embedded in maps #6945 #6938 [Fonger](https://github.com/Fonger)
1273 * fix(query): make castForQuery return a CastError #6943 #6927 [lineus](https://github.com/lineus)
1274 * fix(query): use correct `this` scope when casting query with legacy 2dsphere pairs defined in schema #6939 #6937 [Fonger](https://github.com/Fonger)
1275 * fix(document): avoid crash when calling `get()` on deeply nested subdocs #6929 #6925 [jakemccloskey](https://github.com/jakemccloskey)
1276 * fix(plugins): make saveSubdocs execute child post save hooks _after_ the actual save #6926
1277 * docs: add dbName to api docs for .connect() #6923 [p722](https://github.com/p722)
1278 * fix(populate): convert to array when schema specifies array, even if doc doesn't have an array #6908
1279 * fix(populate): handle `justOne` virtual populate underneath array #6867
1280 * fix(model): dont set versionKey on upsert if it is already `$set` #5973
1281
12824.13.16 / 2018-08-30
1283====================
1284 * fix(document): disallow setting __proto__ if strict mode false
1285 * feat(error): backport adding modified paths to VersionError #6928 [freewil](https://github.com/freewil)
1286
12875.2.10 / 2018-08-27
1288===================
1289 * fix: bump mongodb driver -> 3.1.4 #6920 #6903 #6884 #6799 #6741 [Fonger](https://github.com/Fonger)
1290 * fix(model): track `session` option for `save()` as the document's `$session()` #6909
1291 * fix(query): add Query.getOptions() helper #6907 [Fonger](https://github.com/Fonger)
1292 * fix(document): ensure array atomics get cleared after save() #6900
1293 * fix(aggregate): add missing redact and readConcern helpers #6895 [Fonger](https://github.com/Fonger)
1294 * fix: add global option `mongoose.set('useCreateIndex', true)` to avoid ensureIndex deprecation warning #6890
1295 * fix(query): use `projection` option to avoid deprecation warnings #6888 #6880 [Fonger](https://github.com/Fonger)
1296 * fix(query): use `findOneAndReplace()` internally if using `overwrite: true` with `findOneAndUpdate()` #6888 [Fonger](https://github.com/Fonger)
1297 * fix(document): ensure required cache gets cleared correctly between subsequent saves #6892
1298 * fix(aggregate): support session chaining correctly #6886 #6885 [Fonger](https://github.com/Fonger)
1299 * fix(query): use `projection` instead of `fields` internally for `find()` and `findOne()` to avoid deprecation warning #6880
1300 * fix(populate): add `getters` option to opt in to calling getters on populate #6844
1301
13025.2.9 / 2018-08-17
1303==================
1304 * fix(document): correctly propagate write concern options in save() #6877 [Fonger](https://github.com/Fonger)
1305 * fix: upgrade mongodb driver -> 3.1.3 for numerous fixes #6869 #6843 #6692 #6670 [simllll](https://github.com/simllll)
1306 * fix: correct `this` scope of default functions for DocumentArray and Array #6868 #6840 [Fonger](https://github.com/Fonger)
1307 * fix(types): support casting JSON form of buffers #6866 #6863 [Fonger](https://github.com/Fonger)
1308 * fix(query): get global runValidators option correctly #6865 #6578
1309 * fix(query): add Query.prototype.setQuery() analogous to `getQuery()` #6855 #6854
1310 * docs(connections): add note about the `family` option for IPv4 vs IPv6 and add port to example URIs #6784
1311 * fix(query): get global runValidators option correctly #6578
1312
13134.13.15 / 2018-08-14
1314====================
1315 * fix(mongoose): add global `usePushEach` option for easier Mongoose 4.x + MongoDB 3.6 #6858
1316 * chore: fix flakey tests for 4.x #6853 [Fonger](https://github.com/Fonger)
1317 * feat(error): add version number to VersionError #6852 [freewil](https://github.com/freewil)
1318
13195.2.8 / 2018-08-13
1320==================
1321 * docs: update `execPopulate()` code example #6851 [WJakub](https://github.com/WJakub)
1322 * fix(document): allow passing callback to `execPopulate()` #6851
1323 * fix(populate): populate with undefined fields without error #6848 #6845 [Fonger](https://github.com/Fonger)
1324 * docs(migrating_to_5): Add `objectIdGetter` option docs #6842 [jwalton](https://github.com/jwalton)
1325 * chore: run lint in parallel and only on Node.js v10 #6836 [Fonger](https://github.com/Fonger)
1326 * fix(populate): throw helpful error if refPath excluded in query #6834
1327 * docs(migrating_to_5): add note about removing runSettersOnQuery #6832
1328 * fix: use safe-buffer to avoid buffer deprecation errors in Node.js 10 #6829 [Fonger](https://github.com/Fonger)
1329 * docs(query): fix broken links #6828 [yaynick](https://github.com/yaynick)
1330 * docs(defaults): clarify that defaults only run on undefined #6827
1331 * chore: fix flakey tests #6824 [Fonger](https://github.com/Fonger)
1332 * docs: fix custom inspect function deprecation warning in Node.js 10 #6821 [yelworc](https://github.com/yelworc)
1333 * fix(document): ensure subdocs get set to init state after save() so validators can run again #6818
1334 * fix(query): make sure embedded query casting always throws a CastError #6803
1335 * fix(document): ensure `required` function only gets called once when validating #6801
1336 * docs(connections): note that you must specify port if using `useNewUrlParser: true` #6789
1337 * fix(populate): support `options.match` in virtual populate schema definition #6787
1338 * fix(update): strip out virtuals from updates if strict: 'throw' rather than returning an error #6731
1339
13405.2.7 / 2018-08-06
1341==================
1342 * fix(model): check `expireAfterSeconds` option when diffing indexes in syncIndexes() #6820 #6819 [christopherhex](https://github.com/christopherhex)
1343 * chore: fix some common test flakes in travis #6816 [Fonger](https://github.com/Fonger)
1344 * chore: bump eslint and webpack to avoid bad versions of eslint-scope #6814
1345 * test(model): add delay to session tests to improve pass rate #6811 [Fonger](https://github.com/Fonger)
1346 * fix(model): support options in `deleteMany` #6810 [Fonger](https://github.com/Fonger)
1347 * fix(query): don't use $each when pushing an array into an array #6809 [lineus](https://github.com/lineus)
1348 * chore: bump mquery so eslint isn't a prod dependency #6800
1349 * fix(populate): correctly get schema type when calling `populate()` on already populated path #6798
1350 * fix(populate): propagate readConcern options in populate from parent query #6792 #6785 [Fonger](https://github.com/Fonger)
1351 * docs(connection): add description of useNewUrlParser option #6789
1352 * fix(query): make select('+path') a no-op if no select prop in schema #6785
1353 * docs(schematype+validation): document using function syntax for custom validator message #6772
1354 * fix(update): throw CastError if updating with `$inc: null` #6770
1355 * fix(connection): throw helpful error when calling `createConnection(undefined)` #6763
1356
13575.2.6 / 2018-07-30
1358==================
1359 * fix(document): don't double-call deeply nested custom getters when using `get()` #6779 #6637
1360 * fix(query): upgrade mquery for readConcern() helper #6777
1361 * docs(schematypes): clean up typos #6773 [sajadtorkamani](https://github.com/sajadtorkamani)
1362 * refactor(browser): fix webpack warnings #6771 #6705
1363 * fix(populate): make error reported when no `localField` specified catchable #6767
1364 * docs(connection): use correct form in createConnection example #6766 [lineus](https://github.com/lineus)
1365 * fix(connection): throw helpful error when using legacy `mongoose.connect()` syntax #6756
1366 * fix(document): handle overwriting `$session` in `execPopulate()` #6754
1367 * fix(query): propagate top-level session down to `populate()` #6754
1368 * fix(aggregate): add `session()` helper for consistency with query api #6752
1369 * fix(map): avoid infinite recursion when update overwrites a map #6750
1370 * fix(model): be consistent about passing noop callback to mongoose.model() `init()` as well as db.model() #6707
1371
13725.2.5 / 2018-07-23
1373==================
1374 * fix(boolean): expose `convertToTrue` and `convertToFalse` for custom boolean casting #6758
1375 * docs(schematypes): add note about what values are converted to booleans #6758
1376 * fix(document): fix(document): report castError when setting single nested doc to array #6753
1377 * docs: prefix mongoose.Schema call with new operator #6751 [sajadtorkamani](https://github.com/sajadtorkamani)
1378 * docs(query): add examples and links to schema writeConcern option for writeConcern helpers #6748
1379 * docs(middleware): clarify that init middleware is sync #6747
1380 * perf(model): create error rather than modifying stack for source map perf #6735
1381 * fix(model): throw helpful error when passing object to aggregate() #6732
1382 * fix(model): pass Model instance as context to applyGetters when calling getters for virtual populate #6726 [lineus](https://github.com/lineus)
1383 * fix(documentarray): remove `isNew` and `save` listeners on CastError because otherwise they never get removed #6723
1384 * docs(model+query): clarify when to use `countDocuments()` vs `estimatedDocumentCount()` #6713
1385 * fix(populate): correctly set virtual nestedSchemaPath when calling populate() multiple times #6644
1386 * docs(connections): add note about the `family` option for IPv4 vs IPv6 and add port to example URIs #6566
1387
13885.2.4 / 2018-07-16
1389==================
1390 * docs: Model.insertMany rawResult option in api docs #6724 [lineus](https://github.com/lineus)
1391 * docs: fix typo on migrating to 5 guide #6722 [iagowp](https://github.com/iagowp)
1392 * docs: update doc about keepalive #6719 #6718 [simllll](https://github.com/simllll)
1393 * fix: ensure debug mode doesn't crash with sessions #6712
1394 * fix(document): report castError when setting single nested doc to primitive value #6710
1395 * fix(connection): throw helpful error if using `new db.model(foo)(bar)` #6698
1396 * fix(model): throw readable error with better stack trace when non-cb passed to $wrapCallback() #6640
1397
13985.2.3 / 2018-07-11
1399==================
1400 * fix(populate): if a getter is defined on the localField, use it when populating #6702 #6618 [lineus](https://github.com/lineus)
1401 * docs(schema): add example of nested aliases #6671
1402 * fix(query): add `session()` function to queries to avoid positional argument mistakes #6663
1403 * docs(transactions): use new session() helper to make positional args less confusing #6663
1404 * fix(query+model+schema): add support for `writeConcern` option and writeConcern helpers #6620
1405 * docs(guide): add `writeConcern` option and re-add description for `safe` option #6620
1406 * docs(schema): fix broken API links #6619
1407 * docs(connections): add information re: socketTimeoutMS and connectTimeoutMS #4789
1408
14095.2.2 / 2018-07-08
1410==================
1411 * fix(model+query): add missing estimatedDocumentCount() function #6697
1412 * docs(faq): improve array-defaults section #6695 [lineus](https://github.com/lineus)
1413 * docs(model): fix countDocuments() docs, bad copy/paste from count() docs #6694 #6643
1414 * fix(connection): add `startSession()` helper to connection and mongoose global #6689
1415 * fix: upgrade mongodb driver -> 3.1.1 for countDocuments() fix #6688 #6666
1416 * docs(compatibility): add MongoDB 4 range #6685
1417 * fix(populate): add ability to define refPath as a function #6683 [lineus](https://github.com/lineus)
1418 * docs: add rudimentary transactions guide #6672
1419 * fix(update): make setDefaultsOnInsert handle nested subdoc updates with deeply nested defaults #6665
1420 * docs: use latest acquit-ignore to handle examples that start with acquit:ignore:start #6657
1421 * fix(validation): format `properties.message` as well as `message` #6621
1422
14235.2.1 / 2018-07-03
1424==================
1425 * fix(connection): allow setting the mongodb driver's useNewUrlParser option, default to false #6656 #6648 #6647
1426 * fix(model): only warn on custom _id index if index only has _id key #6650
1427
14285.2.0 / 2018-07-02
1429==================
1430 * feat(model): add `countDocuments()` #6643
1431 * feat(model): make ensureIndexes() fail if specifying an index on _id #6605
1432 * feat(mongoose): add `objectIdGetter` option to remove ObjectId.prototype._id #6588
1433 * feat: upgrade mongodb -> 3.1.0 for full MongoDB 4.0 support #6579
1434 * feat(query): support `runValidators` as a global option #6578
1435 * perf(schema): use WeakMap instead of array for schema stack #6503
1436 * feat(model): decorate unique discriminator indexes with partialFilterExpressions #6347
1437 * feat(model): add `syncIndexes()`, drops indexes that aren't in schema #6281
1438 * feat(document): add default getter/setter if virtual doesn't have one #6262
1439 * feat(discriminator): support discriminators on nested doc arrays #6202
1440 * feat(update): add `Query.prototype.set()` #5770
1441
14425.1.8 / 2018-07-02
1443==================
1444 * fix: don't throw TypeError if calling save() after original save() failed with push() #6638 [evanhenke](https://github.com/evanhenke)
1445 * fix(query): add explain() helper and don't hydrate explain output #6625
1446 * docs(query): fix `setOptions()` lists #6624
1447 * docs: add geojson docs #6607
1448 * fix: bump mongodb -> 3.0.11 to avoid cyclic dependency error with retryWrites #6109
1449
14505.1.7 / 2018-06-26
1451==================
1452 * docs: add npm badge to readme #6623 [VFedyk](https://github.com/VFedyk)
1453 * fix(document): don't throw parallel save error if post save hooks in parallel #6614 #6611 [lineus](https://github.com/lineus)
1454 * fix(populate): allow dynamic ref to handle >1 model getModelsMapForPopulate #6613 #6612 [jimmytsao](https://github.com/jimmytsao)
1455 * fix(document): handle `push()` on triple nested document array #6602
1456 * docs(validation): improve update validator doc headers #6577 [joeytwiddle](https://github.com/joeytwiddle)
1457 * fix(document): handle document arrays in `modifiedPaths()` with includeChildren option #5904
1458
14595.1.6 / 2018-06-19
1460==================
1461 * fix: upgrade mongodb -> 3.0.10
1462 * docs(model+document): clarify that `save()` returns `undefined` if passed a callback #6604 [lineus](https://github.com/lineus)
1463 * fix(schema): apply alias when adding fields with .add() #6593
1464 * docs: add full list of guides and streamline nav #6592
1465 * docs(model): add `projection` option to `findOneAndUpdate()` #6590 [lineus](https://github.com/lineus)
1466 * docs: support @static JSDoc declaration #6584
1467 * fix(query): use boolean casting logic for $exists #6581
1468 * fix(query): cast all $text options to correct values #6581
1469 * fix(model): add support synchronous pre hooks for `createModel` #6552 [profbiss](https://github.com/profbiss)
1470 * docs: add note about the `applyPluginsToDiscriminators` option #4965
1471
14725.1.5 / 2018-06-11
1473==================
1474 * docs(guide): rework query helper example #6575 [lineus](https://github.com/lineus)
1475 * fix(populate): handle virtual populate with embedded discriminator under single nested subdoc #6571
1476 * docs: add string option to projections that call query select #6563 [lineus](https://github.com/lineus)
1477 * style: use ES6 in collection.js #6560 [l33ds](https://github.com/l33ds)
1478 * fix(populate): add virtual ref function ability getModelsMapForPopulate #6559 #6554 [lineus](https://github.com/lineus)
1479 * docs(queries): fix link #6557 [sun1x](https://github.com/sun1x)
1480 * fix(schema): rename indexes -> getIndexes to avoid webpack duplicate declaration #6547
1481 * fix(document): support `toString()` as custom method #6538
1482 * docs: add @instance for instance methods to be more compliant with JSDoc #6516 [treble-snake](https://github.com/treble-snake)
1483 * fix(populate): avoid converting to map when using mongoose-deep-populate #6460
1484 * docs(browser): create new browser docs page #6061
1485
14865.1.4 / 2018-06-04
1487==================
1488 * docs(faq): add hr tags for parallel save error #6550 [lineus](https://github.com/lineus)
1489 * docs(connection): fix broken link #6545 [iblamefish](https://github.com/iblamefish)
1490 * fix(populate): honor subpopulate options #6539 #6528 [lineus](https://github.com/lineus)
1491 * fix(populate): allow population of refpath under array #6537 #6509 [lineus](https://github.com/lineus)
1492 * fix(query): dont treat $set the same as the other ops in update casting #6535 [lineus](https://github.com/lineus)
1493 * fix: bump async -> 2.6.1 #6534 #6505 [lineus](https://github.com/lineus)
1494 * fix: support using a function as validation error message #6530 [lucandrade](https://github.com/lucandrade)
1495 * fix(populate): propagate `lean()` down to subpopulate #6498 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
1496 * docs(lambda): add info on what happens if database does down between lambda function calls #6409
1497 * fix(update): allow updating embedded discriminator path if discriminator key is in filter #5841
1498
14995.1.3 / 2018-05-28
1500==================
1501 * fix(document): support set() on path underneath array embedded discriminator #6526
1502 * chore: update lodash and nsp dev dependencies #6514 [ChristianMurphy](https://github.com/ChristianMurphy)
1503 * fix(document): throw readable error when saving the same doc instance more than once in parallel #6511 #6456 #4064 [lineus](https://github.com/lineus)
1504 * fix(populate): set correct nestedSchemaPath for virtual underneath embedded discriminator #6501 #6487 [lineus](https://github.com/lineus)
1505 * docs(query): add section on promises and warning about not mixing promises and callbacks #6495
1506 * docs(connection): add concrete example of connecting to multiple hosts #6492 [lineus](https://github.com/lineus)
1507 * fix(populate): handle virtual populate under single nested doc under embedded discriminator #6488
1508 * fix(schema): collect indexes from embedded discriminators for autoIndex build #6485
1509 * fix(document): handle `doc.set()` underneath embedded discriminator #6482
1510 * fix(document): handle set() on path under embedded discriminator with object syntax #6482
1511 * fix(document): handle setting nested property to object with only non-schema properties #6436
1512
15134.13.14 / 2018-05-25
1514====================
1515 * fix(model): handle retainKeyOrder option in findOneAndUpdate() #6484
1516
15175.1.2 / 2018-05-21
1518==================
1519 * docs(guide): add missing SchemaTypes #6490 [distancesprinter](https://github.com/distancesprinter)
1520 * fix(map): make MongooseMap.toJSON return a serialized object #6486 #6478 [lineus](https://github.com/lineus)
1521 * fix(query): make CustomQuery inherit from model.Query for hooks #6483 #6455 [lineus](https://github.com/lineus)
1522 * fix(document): prevent default falses from being skipped by $__dirty #6481 #6477 [lineus](https://github.com/lineus)
1523 * docs(connection): document `useDb()` #6480
1524 * fix(model): skip redundant clone in insertMany #6479 [d1manson](https://github.com/d1manson)
1525 * fix(aggregate): let replaceRoot accept objects as well as strings #6475 #6474 [lineus](https://github.com/lineus)
1526 * docs(model): clarify `emit()` in mapReduce and how map/reduce are run #6465
1527 * fix(populate): flatten array to handle multi-level nested `refPath` #6457
1528 * fix(date): cast small numeric strings as years #6444 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
1529 * fix(populate): remove unmatched ids when using virtual populate on already hydrated document #6435
1530 * fix(array): use custom array class to avoid clobbered property names #6431
1531 * fix(model): handle hooks for custom methods that return promises #6385
1532
15334.13.13 / 2018-05-17
1534====================
1535 * fix(update): stop clobbering $in when casting update #6441 #6339
1536 * fix: upgrade async -> 2.6.0 re: security warning
1537
15385.1.1 / 2018-05-14
1539==================
1540 * docs(schema): add notes in api and guide about schema.methods object #6470 #6440 [lineus](https://github.com/lineus)
1541 * fix(error): add modified paths to VersionError #6464 #6433 [paglias](https://github.com/paglias)
1542 * fix(populate): only call populate with full param signature when match is not present #6458 #6451 [lineus](https://github.com/lineus)
1543 * docs: fix geoNear link in migration guide #6450 [kawache](https://github.com/kawache)
1544 * fix(discriminator): throw readable error when `create()` with a non-existent discriminator key #6434
1545 * fix(populate): add `retainNullValues` option to avoid stripping out null keys #6432
1546 * fix(populate): handle populate in embedded discriminators underneath nested paths #6411
1547 * docs(model): add change streams and ToC, make terminology more consistent #5888
1548
15495.1.0 / 2018-05-10
1550==================
1551 * feat(ObjectId): add `_id` getter so you can get a usable id whether or not the path is populated #6415 #6115
1552 * feat(model): add Model.startSession() #6362
1553 * feat(document): add doc.$session() and set session on doc after query #6362
1554 * feat: add Map type that supports arbitrary keys #6287 #681
1555 * feat: add `cloneSchemas` option to mongoose global to opt in to always cloning schemas before use #6274
1556 * feat(model): add `findOneAndDelete()` and `findByIdAndDelete()` #6164
1557 * feat(document): support `$ignore()` on single nested and array subdocs #6152
1558 * feat(document): add warning about calling `save()` on subdocs #6152
1559 * fix(model): make `save()` use `updateOne()` instead of `update()` #6031
1560 * feat(error): add version number to VersionError #5966
1561 * fix(query): allow `[]` as a value for `$in` when casting #5913
1562 * fix(document): avoid running validators on single nested paths if only a child path is modified #5885
1563 * feat(schema): print warning if method conflicts with mongoose internals #5860
1564
15655.0.18 / 2018-05-09
1566===================
1567 * fix(update): stop clobbering $in when casting update #6441 #6339 [lineus](https://github.com/lineus)
1568 * fix: upgrade mongodb driver -> 3.0.8 to fix session issue #6437 #6357 [simllll](https://github.com/simllll)
1569 * fix: upgrade bson -> 1.0.5 re: https://snyk.io/vuln/npm:bson:20180225 #6423 [ChristianMurphy](https://github.com/ChristianMurphy)
1570 * fix: look for `valueOf()` when casting to Decimal128 #6419 #6418 [lineus](https://github.com/lineus)
1571 * fix: populate array of objects with space separated paths #6414 [lineus](https://github.com/lineus)
1572 * test: add coverage for `mongoose.pluralize()` #6412 [FastDeath](https://github.com/FastDeath)
1573 * fix(document): avoid running default functions on init() if path has value #6410
1574 * fix(document): allow saving document with `null` id #6406
1575 * fix: prevent casting of populated docs in document.init #6390 [lineus](https://github.com/lineus)
1576 * fix: remove `toHexString()` helper that was added in 5.0.15 #6359
1577
15785.0.17 / 2018-04-30
1579===================
1580 * docs(migration): certain chars in passwords may cause connection failures #6401 [markstos](https://github.com/markstos)
1581 * fix(document): don't throw when `push()` on a nested doc array #6398
1582 * fix(model): apply hooks to custom methods if specified #6385
1583 * fix(schema): support opting out of one timestamp field but not the other for `insertMany()` #6381
1584 * fix(documentarray): handle `required: true` within documentarray definition #6364
1585 * fix(document): ensure `isNew` is set before default functions run on init #3793
1586
15875.0.16 / 2018-04-23
1588===================
1589 * docs(api): sort api methods based on their string property #6374 [lineus](https://github.com/lineus)
1590 * docs(connection): fix typo in `createCollection()` #6370 [mattc41190](https://github.com/mattc41190)
1591 * docs(document): remove vestigial reference to `numAffected` #6367 [ekulabuhov](https://github.com/ekulabuhov)
1592 * docs(schema): fix typo #6366 [dhritzkiv](https://github.com/dhritzkiv)
1593 * docs(schematypes): add missing `minlength` and `maxlength` docs #6365 [treble-snake](https://github.com/treble-snake)
1594 * docs(queries): fix formatting #6360 [treble-snake](https://github.com/treble-snake)
1595 * docs(api): add cursors to API docs #6353 #6344 [lineus](https://github.com/lineus)
1596 * docs(aggregate): remove reference to non-existent `.select()` method #6346
1597 * fix(update): handle `required` array with update validators and $pull #6341
1598 * fix(update): avoid setting __v in findOneAndUpdate if it is `$set` #5973
1599
16005.0.15 / 2018-04-16
1601===================
1602 * fix: add ability for casting from number to decimal128 #6336 #6331 [lineus](https://github.com/lineus)
1603 * docs(middleware): enumerate the ways to error out in a hook #6315
1604 * fix(document): respect schema-level depopulate option for toObject() #6313
1605 * fix: bump mongodb driver -> 3.0.6 #6310
1606 * fix(number): check for `valueOf()` function to support Decimal.js #6306 #6299 [lineus](https://github.com/lineus)
1607 * fix(query): run array setters on query if input value is an array #6277
1608 * fix(versioning): don't require matching version when using array.pull() #6190
1609 * fix(document): add `toHexString()` function so you don't need to check whether a path is populated to get an id #6115
1610
16115.0.14 / 2018-04-09
1612===================
1613 * fix(schema): clone aliases and alternative option syntax correctly
1614 * fix(query): call utils.toObject in query.count like in query.find #6325 [lineus](https://github.com/lineus)
1615 * docs(populate): add middleware examples #6320 [BorntraegerMarc](https://github.com/BorntraegerMarc)
1616 * docs(compatibility): fix dead link #6319 [lacivert](https://github.com/lacivert)
1617 * docs(api): fix markdown parsing for parameters #6318 #6314 [lineus](https://github.com/lineus)
1618 * fix(populate): handle space-delimited paths in array populate #6296 #6284 [lineus](https://github.com/lineus)
1619 * fix(populate): support basic virtual populate underneath embedded discriminators #6273
1620
16215.0.13 / 2018-04-05
1622===================
1623 * docs(faq): add middleware to faq arrow function warning #6309 [lineus](https://github.com/lineus)
1624 * docs(schema): add example to loadClass() docs #6308
1625 * docs: clean up misc typos #6304 [sfrieson](https://github.com/sfrieson)
1626 * fix(document): apply virtuals when calling `toJSON()` on a nested path #6294
1627 * refactor(connection): use `client.db()` syntax rather than double-parsing the URI #6292 #6286
1628 * docs: document new behavior of required validator for arrays #6288 [daltones](https://github.com/daltones)
1629 * fix(schema): treat set() options as user-provided options #6274
1630 * fix(schema): clone discriminators correctly #6274
1631 * fix(update): make setDefaultsOnInsert not create subdoc if only default is id #6269
1632 * docs(discriminator): clarify 3rd argument to Model.discriminator() #2596
1633
16345.0.12 / 2018-03-27
1635===================
1636 * docs(query): updating model name in query API docs #6280 [lineus](https://github.com/lineus)
1637 * docs: fix typo in tests #6275 [styler](https://github.com/styler)
1638 * fix: add missing `.hint()` to aggregate #6272 #6251 [lineus](https://github.com/lineus)
1639 * docs(api): add headers to each API docs section for easer nav #6261
1640 * fix(query): ensure hooked query functions always run on next tick for chaining #6250
1641 * fix(populate): ensure populated array not set to null if it isn't set #6245
1642 * fix(connection): set readyState to disconnected if initial connection fails #6244 #6131
1643 * docs(model): make `create()` params show up correctly in docs #6242
1644 * fix(model): make error handlers work with MongoDB server errors and `insertMany()` #6228
1645 * fix(browser): ensure browser document builds defaults for embedded arrays correctly #6175
1646 * fix(timestamps): set timestamps when using `updateOne()` and `updateMany()` #6282 [gualopezb](https://github.com/gualopezb)
1647
16485.0.11 / 2018-03-19
1649===================
1650 * fix(update): handle $pull with $in in update validators #6240
1651 * fix(query): don't convert undefined to null when casting so driver `ignoreUndefined` option works #6236
1652 * docs(middleware): add example of using async/await with middleware #6235
1653 * fix(populate): apply justOne option before `completeMany()` so it works with lean() #6234
1654 * fix(query): ensure errors in user callbacks aren't caught in init #6195 #6178
1655 * docs(connections): document dbName option for Atlas connections #6179
1656 * fix(discriminator): make child schema nested paths overwrite parent schema paths #6076
1657
16584.13.12 / 2018-03-13
1659====================
1660 * fix(document): make virtual get() return undefined instead of null if no getters #6223
1661 * docs: fix url in useMongoClient error message #6219 #6217 [lineus](https://github.com/lineus)
1662 * fix(discriminator): don't copy `discriminators` property from base schema #6122 #6064
1663
16645.0.10 / 2018-03-12
1665===================
1666 * docs(schematype): add notes re: running setters on queries #6209
1667 * docs: fix typo #6208 [kamagatos](https://github.com/kamagatos)
1668 * fix(query): only call setters once on query filter props for findOneAndUpdate and findOneAndRemove #6203
1669 * docs: elaborate on connection string changes in migration guide #6193
1670 * fix(document): skip applyDefaults if subdoc is null #6187
1671 * docs: fix schematypes docs and link to them #6176
1672 * docs(faq): add FAQs re: array defaults and casting aggregation pipelines #6184 #6176 #6170 [lineus](https://github.com/lineus)
1673 * fix(document): ensure primitive defaults are set and built-in default functions run before setters #6155
1674 * fix(query): handle single embedded embedded discriminators in castForQuery #6027
1675
16765.0.9 / 2018-03-05
1677==================
1678 * perf: bump mongodb -> 3.0.4 to fix SSL perf issue #6065
1679
16805.0.8 / 2018-03-03
1681==================
1682 * docs: remove obsolete references to `emitIndexErrors` #6186 [isaackwan](https://github.com/isaackwan)
1683 * fix(query): don't cast findOne() until exec() so setters don't run twice #6157
1684 * fix: remove document_provider.web.js file #6186
1685 * fix(discriminator): support custom discriminator model names #6100 [wentout](https://github.com/wentout)
1686 * fix: support caching calls to `useDb()` #6036 [rocketspacer](https://github.com/rocketspacer)
1687 * fix(query): add omitUndefined option so setDefaultsOnInsert can kick in on undefined #6034
1688 * fix: upgrade mongodb -> 3.0.3 for reconnectTries: 0 blocking process exit fix #6028
1689
16905.0.7 / 2018-02-23
1691==================
1692 * fix: support eachAsync options with aggregation cursor #6169 #6168 [vichle](https://github.com/vichle)
1693 * docs: fix link to MongoDB compound indexes docs #6162 [br0p0p](https://github.com/br0p0p)
1694 * docs(aggregate): use eachAsync instead of incorrect `each()` #6160 [simllll](https://github.com/simllll)
1695 * chore: fix benchmarks #6158 [pradel](https://github.com/pradel)
1696 * docs: remove dead link to old blog post #6154 [markstos](https://github.com/markstos)
1697 * fix: don't convert dates to numbers when updating mixed path #6146 #6145 [s4rbagamble](https://github.com/s4rbagamble)
1698 * feat(aggregate): add replaceRoot, count, sortByCount helpers #6142 [jakesjews](https://github.com/jakesjews)
1699 * fix(document): add includedChildren flag to modifiedPaths() #6134
1700 * perf: don't create wrapper function if no hooks specified #6126
1701 * fix(schema): allow indexes on single nested subdocs for geoJSON #6113
1702 * fix(document): allow depopulating all fields #6073
1703 * feat(mongoose): add support for `useFindAndModify` option on singleton #5616
1704
17055.0.6 / 2018-02-15
1706==================
1707 * refactor(query.castUpdate): avoid creating error until necessary #6137
1708 * docs(api): fix missing api docs #6136 [lineus](https://github.com/lineus)
1709 * fix(schema): copy virtuals when using `clone()` #6133
1710 * fix(update): avoid digging into buffers with upsert and replaceOne #6124
1711 * fix(schema): support `enum` on arrays of strings #6102
1712 * fix(update): cast `$addToSet: [1, 2]` -> `$addToSet: { $each: [1, 2] }` #6086
1713
17145.0.5 / 2018-02-13
1715==================
1716 * docs: make > show up correctly in API docs #6114
1717 * fix(query): support `where()` overwriting primitive with object #6097
1718 * fix(schematype): don't run internal `resetId` setter on queries with _id #6093
1719 * fix(discriminator): don't copy `discriminators` property from base schema #6064
1720 * fix(utils): respect `valueOf()` when merging object for update #6059
1721 * docs(validation): fix typo 'maxLength' #4720
1722 * fix(document): apply defaults after setting initial value so default functions don't see empty doc #3781
1723
17245.0.4 / 2018-02-08
1725==================
1726 * docs: add lambda guide #6107
1727 * fix(connection): add `dbName` option to work around `mongodb+srv` not supporting db name in URI #6106
1728 * fix(schematype): fix regexp typo in ObjectId #6098 [JoshuaWise](https://github.com/JoshuaWise)
1729 * perf(document): re-use the modifiedPaths list #6092 [tarun1793](https://github.com/tarun1793)
1730 * fix: use console.info() instead of console.error() for debug output #6088 [yuristsepaniuk](https://github.com/yuristsepaniuk)
1731 * docs(validation): clean up runValidators and isAsync options docs for 5.x #6083
1732 * docs(model): use array instead of spread consistently for aggregate() #6070
1733 * fix(schema): make aliases handle mongoose-lean-virtuals #6069
1734 * docs(layout): add link to subdocs guide #6056
1735 * fix(query): make strictQuery: true strip out fields that aren't in the schema #6032
1736 * docs(guide): add notes for `strictQuery` option #6032
1737
17384.13.11 / 2018-02-07
1739====================
1740 * docs: fix links in 4.x docs #6081
1741 * chore: add release script that uses --tag for npm publish for 4.x releases #6063
1742
17435.0.3 / 2018-01-31
1744==================
1745 * fix: consistently use process.nextTick() to avoid sinon.useFakeTimers() causing ops to hang #6074
1746 * docs(aggregate): fix typo #6072 [adursun](https://github.com/adursun)
1747 * chore: add return type to `mongoose.model()` docs [bryant1410](https://github.com/bryant1410)
1748 * fix(document): depopulate push()-ed docs when saving #6048
1749 * fix: upgrade mongodb -> 3.0.2 #6019
1750
17515.0.2 / 2018-01-28
1752==================
1753 * fix(schema): do not overwrite default values in schema when nested timestamps are provided #6024 [cdeveas](https://github.com/cdeveas)
1754 * docs: fix syntax highlighting in models.jade, schematypes.jade, subdocs.jade #6058 [lineus](https://github.com/lineus)
1755 * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
1756 * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
1757 * fix(populate): handle populating embedded discriminator paths #5970
1758
17594.13.10 / 2018-01-28
1760====================
1761 * docs(model+query): add lean() option to Model helpers #5996 [aguyinmontreal](https://github.com/aguyinmontreal)
1762 * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
1763 * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
1764 * fix(populate): handle populating embedded discriminator paths #5970
1765 * docs(query+aggregate): add more detail re: maxTimeMS #4066
1766
17675.0.1 / 2018-01-19
1768==================
1769 * fix(document): make validate() not resolve to document #6014
1770 * fix(model): make save() not return DocumentNotFoundError if using fire-and-forget writes #6012
1771 * fix(aggregate): make options() work as advertised #6011 [spederiva](https://github.com/spederiva)
1772 * docs(queries): fix code samples #6008
1773
17745.0.0 / 2018-01-17
1775==================
1776 * test: refactor tests to use start fewer connections #5985 [fenanquin](https://github.com/fenanquin)
1777 * feat: add global bufferCommands option #5879
1778 * docs: new docs site and build system #5976
1779 * test: increase timeout on slow test cases #5968 [fenanquin](https://github.com/fenanquin)
1780 * fix: avoid casting out array filter elements #5965
1781 * feat: add Model.watch() wrapper #5964
1782 * chore: replace istanbul with nyc #5962 [ChristianMurphy](https://github.com/ChristianMurphy)
1783
17844.13.9 / 2018-01-07
1785===================
1786 * chore: update marked (dev dependency) re: security vulnerability #5951 [ChristianMurphy](https://github.com/ChristianMurphy)
1787 * fix: upgrade mongodb -> 2.2.34 for ipv6 and autoReconnect fixes #5794 #5760
1788 * docs: use useMongooseAggCursor for aggregate docs #2955
1789
17905.0.0-rc2 / 2018-01-04
1791======================
1792 * fix: add cleaner warning about no longer needing `useMongoClient` in 5.x #5961
1793 * chore: update acquit -> 0.5.1 for minor security patch #5961 [ChristianMurphy](https://github.com/ChristianMurphy)
1794 * docs: add docs for mongoose 4.x at http://mongoosejs.com/docs/4.x #5959
1795 * docs: add link to migration guide #5957
1796 * chore: update eslint to version 4.14.0 #5955 [ChristianMurphy](https://github.com/ChristianMurphy)
1797 * chore: update mocha to version 4.1.0 [ChristianMurphy](https://github.com/ChristianMurphy)
1798
17995.0.0-rc1 / 2018-01-02
1800======================
1801 * fix(index): use pluralize correctly for `mongoose.model()` #5958
1802 * fix: make mquery use native promises by default #5945
1803 * fix(connection): ensure 'joined' and 'left' events get bubbled up #5944
1804
18055.0.0-rc0 / 2017-12-28
1806======================
1807 * BREAKING CHANGE: always use mongoose aggregation cursor when using `.aggregate().cursor()` #5941
1808 * BREAKING CHANGE: attach query middleware when compiling model #5939
1809 * BREAKING CHANGE: `emitIndexErrors` is on by default, failing index build will throw uncaught error if not handled #5910
1810 * BREAKING CHANGE: remove precompiled browser bundle #5895
1811 * feat: add `mongoose.pluralize()` function #5877
1812 * BREAKING CHANGE: remove `passRawResult` option for `findOneAndUpdate`, use `rawResult` #5869
1813 * BREAKING CHANGE: implicit async validators (based on number of function args) are removed, return a promise instead #5824
1814 * BREAKING CHANGE: fail fast if user sets a unique index on `_id` #5820 [varunjayaraman](https://github.com/varunjayaraman)
1815 * BREAKING CHANGE: mapReduce resolves to an object with 2 keys rather than 2 separate args #5816
1816 * BREAKING CHANGE: `mongoose.connect()` returns a promise, removed MongooseThenable #5796
1817 * BREAKING CHANGE: query stream removed, use `cursor()` instead #5795
1818 * BREAKING CHANGE: connection `open()` and `openSet()` removed, use `openUri()` instead #5795
1819 * BREAKING CHANGE: use MongoDB driver 3.0.0, drop support for MongoDB server < 3.0.0 #5791 #4740
1820 * BREAKING CHANGE: remove support for `$pushAll`, remove `usePushEach` option #5670
1821 * BREAKING CHANGE: make date casting use native Date #5395 [varunjayaraman](https://github.com/varunjayaraman)
1822 * BREAKING CHANGE: remove `runSettersOnQuery`, always run setters on query #5340
1823 * BREAKING CHANGE: array of length 0 now satisfies `required: true` for arays #5139 [wlingke](https://github.com/wlingke)
1824 * BREAKING CHANGE: remove `saveErrorIfNotFound`, always error out if `save()` did not update a document #4973
1825 * BREAKING CHANGE: don't execute getters in reverse order #4835
1826 * BREAKING CHANGE: make boolean casting more strict #4245
1827 * BREAKING CHANGE: `toObject()` and `toJSON()` option parameter merges with defaults rather than overwriting #4131
1828 * feat: allow setting `default` on `_id` #4069
1829 * BREAKING CHANGE: `deleteX()` and `remove()` promise resolves to the write object result #4013
1830 * feat: support returning a promise from middleware functions #3779
1831 * BREAKING CHANGE: don't return a promise if callback specified #3670
1832 * BREAKING CHANGE: only cast `update()`, `updateX()`, `replaceOne()`, `remove()`, `deleteX()` in exec #3529
1833 * BREAKING CHANGE: sync errors in middleware functions are now handled #3483
1834 * BREAKING CHANGE: post hooks get flow control #3232
1835 * BREAKING CHANGE: deduplicate hooks when merging discriminator schema #2945
1836 * BREAKING CHANGE: use native promises by default, remove support for mpromise #2917
1837 * BREAKING CHANGE: remove `retainKeyOrder`, always use forward order when iterating through objects #2749
1838 * BREAKING CHANGE: `aggregate()` no longer accepts a spread #2716
1839
18404.13.8 / 2017-12-27
1841===================
1842 * docs(guide): use more up-to-date syntax for autoIndex example #5933
1843 * docs: fix grammar #5927 [abagh0703](https://github.com/abagh0703)
1844 * fix: propagate lean options to child schemas #5914
1845 * fix(populate): use correct model with discriminators + nested populate #5858
1846
18474.13.7 / 2017-12-11
1848===================
1849 * docs(schematypes): fix typo #5889 [gokaygurcan](https://github.com/gokaygurcan)
1850 * fix(cursor): handle `reject(null)` with eachAsync callback #5875 #5874 [ZacharyRSmith](https://github.com/ZacharyRSmith)
1851 * fix: disallow setting `mongoose.connection` to invalid values #5871 [jinasonlin](https://github.com/jinasonlin)
1852 * docs(middleware): suggest using `return next()` to stop middleware execution #5866
1853 * docs(connection): improve connection string query param docs #5864
1854 * fix(document): run validate hooks on array subdocs even if not directly modified #5861
1855 * fix(discriminator): don't treat $meta as defining projection when querying #5859
1856 * fix(types): handle Decimal128 when using bson-ext on server side #5850
1857 * fix(document): ensure projection with only $slice isn't treated as inclusive for discriminators #4991
1858 * fix(model): throw error when passing non-object to create() #2037
1859
18604.13.6 / 2017-12-02
1861===================
1862 * fix(schema): support strictBool option in schema #5856 [ekulabuhov](https://github.com/ekulabuhov)
1863 * fix(update): make upsert option consistently handle truthy values, not just booleans, for updateOne() #5839
1864 * refactor: remove unnecessary constructor check #2057
1865 * docs(query): correct function signature for .mod() helper #1806
1866 * fix(query): report ObjectParameterError when passing non-object as filter to find() and findOne() #1698
1867
18684.13.5 / 2017-11-24
1869===================
1870 * fix(model): handle update cast errors correctly with bulkWrite #5845 [Michael77](https://github.com/Michael77)
1871 * docs: add link to bufferCommands option #5844 [ralphite](https://github.com/ralphite)
1872 * fix(model): allow virtual ref function to return arrays #5834 [brunohcastro](https://github.com/brunohcastro)
1873 * fix(query): don't throw uncaught error if query filter too big #5812
1874 * fix(document): if setting unselected nested path, don't overwrite nested path #5800
1875 * fix(document): support calling `populate()` on nested document props #5703
1876 * fix: add `strictBool` option for schema type boolean #5344 #5211 #4245
1877 * docs(faq): add faq re: typeKey #1886
1878 * docs(query): add more detailed docs re: options #1702
1879
18804.13.4 / 2017-11-17
1881===================
1882 * fix(aggregate): add chainable .option() helper for setting arbitrary options #5829
1883 * fix(aggregate): add `.pipeline()` helper to get the current pipeline #5825
1884 * docs: grammar fixes for `unique` FAQ #5823 [mfluehr](https://github.com/mfluehr)
1885 * chore: add node 9 to travis #5822 [superheri](https://github.com/superheri)
1886 * fix(model): fix infinite recursion with recursive embedded discriminators #5821 [Faibk](https://github.com/Faibk)
1887
18884.13.3 / 2017-11-15
1889===================
1890 * chore: add node 8 to travis #5818 [superheri](https://github.com/superheri)
1891 * fix(document): don't apply transforms to nested docs when updating already saved doc #5807
1892
18934.13.2 / 2017-11-11
1894===================
1895 * feat(buffer): add support for subtype prop #5530
1896
18974.13.1 / 2017-11-08
1898===================
1899 * fix: accept multiple paths or array of paths to depopulate #5798 #5797 [adamreisnz](https://github.com/adamreisnz)
1900 * fix(document): pass default array as actual array rather than taking first element #5780
1901 * fix(model): increment version when $set-ing it in a save() that requires a version bump #5779
1902 * fix(query): don't explicitly project in discriminator key if user projected in parent path #5775 #5754
1903 * fix(model): cast query option to geoNear() #5765
1904 * fix(query): don't treat projection with just $slice as inclusive #5737
1905 * fix(discriminator): defer applying embedded discriminator hooks until top-level model is compiled #5706
1906 * docs(discriminator): add warning to always attach hooks before calling discriminator() #5706
1907
19084.13.0 / 2017-11-02
1909===================
1910 * feat(aggregate): add $addFields helper #5740 [AyushG3112](https://github.com/AyushG3112)
1911 * feat(connection): add connection-level bufferCommands #5720
1912 * feat(connection): add createCollection() helper #5712
1913 * feat(populate): support setting localField and foreignField to functions #5704 #5602
1914 * feat(query): add multipleCastError option for aggregating cast errors when casting update #5609
1915 * feat(populate): allow passing a function to virtual ref #5602
1916 * feat(schema): add excludeIndexes option to optionally prevent collecting indexes from nested schemas #5575
1917 * feat(model): report validation errors from `insertMany()` if using `ordered: false` and `rawResult: true` #5337
1918 * feat(aggregate): add pre/post aggregate middleware #5251
1919 * feat(schema): allow using `set` as a schema path #1939
1920
19214.12.6 / 2017-11-01
1922===================
1923 * fix(schema): make clone() copy query helpers correctly #5752
1924 * fix: undeprecate `ensureIndex()` and use it by default #3280
1925
19264.12.5 / 2017-10-29
1927===================
1928 * fix(query): correctly handle `$in` and required for $pull and update validators #5744
1929 * feat(aggegate): add $addFields pipeline operator #5740 [AyushG3112](https://github.com/AyushG3112)
1930 * fix(document): catch sync errors in document pre hooks and report as error #5738
1931 * fix(populate): handle slice projections correctly when automatically selecting populated fields #5737
1932 * fix(discriminator): fix hooks for embedded discriminators #5706 [wlingke](https://github.com/wlingke)
1933 * fix(model): throw sane error when customer calls `mongoose.Model()` over `mongoose.model()` #2005
1934
19354.12.4 / 2017-10-21
1936===================
1937 * test(plugins): add coverage for idGetter with id as a schema property #5713 [wlingke](https://github.com/wlingke)
1938 * fix(model): avoid copying recursive $$context object when creating discriminator after querying #5721
1939 * fix(connection): ensure connection promise helpers are removed before emitting 'connected' #5714
1940 * docs(schema): add notes about runSettersOnQuery to schema setters #5705
1941 * fix(collection): ensure queued operations run on the next tick #5562
1942
19434.12.3 / 2017-10-16
1944===================
1945 * fix(connection): emit 'reconnect' event as well as 'reconnected' for consistency with driver #5719
1946 * fix: correctly bubble up left/joined events for replica set #5718
1947 * fix(connection): allow passing in `autoIndex` as top-level option rather than requiring `config.autoIndex` #5711
1948 * docs(connection): improve docs regarding reconnectTries, autoReconnect, and bufferMaxEntries #5711
1949 * fix(query): handle null with addToSet/push/pull/pullAll update validators #5710
1950 * fix(model): handle setDefaultsOnInsert option for bulkWrite updateOne and updateMany #5708
1951 * fix(query): avoid infinite recursion edge case when cloning a buffer #5702
1952
19534.12.2 / 2017-10-14
1954===================
1955 * docs(faq): add FAQ about using arrow functions for getters/setters, virtuals, and methods #5700
1956 * docs(schema): document the childSchemas property and add to public API #5695
1957 * fix(query): don't project in populated field if parent field is already projected in #5669
1958 * fix: bump mongodb -> 2.2.33 for issue with autoReconnect #4513
1959
19604.12.1 / 2017-10-08
1961===================
1962 * fix(document): create new doc when setting single nested, no more set() on copy of priorVal #5693
1963 * fix(model): recursively call applyMethods on child schemas for global plugins #5690
1964 * docs: fix bad promise lib example on home page #5686
1965 * fix(query): handle false when checking for inclusive/exclusive projection #5685
1966 * fix(discriminator): allow reusing child schema #5684
1967 * fix: make addToSet() on empty array with subdoc trigger manual population #5504
1968
19694.12.0 / 2017-10-02
1970===================
1971 * docs(validation): add docs coverage for ValidatorError.reason #5681
1972 * feat(discriminator): always add discriminatorKey to base schema to allow updating #5613
1973 * fix(document): make nested docs no longer inherit parent doc's schema props #5586 #5546 #5470
1974 * feat(query): run update validators on $pull and $pullAll #5555
1975 * feat(query): add .error() helper to query to error out in pre hooks #5520
1976 * feat(connection): add dropCollection() helper #5393
1977 * feat(schema): add schema-level collation option #5295
1978 * feat(types): add `discriminator()` function for single nested subdocs #5244
1979 * feat(document): add $isDeleted() getter/setter for better support for soft deletes #4428
1980 * feat(connection): bubble up reconnectFailed event when driver gives up reconnecting #4027
1981 * fix(query): report error if passing array or other non-object as filter to update query #3677
1982 * fix(collection): use createIndex() instead of deprecated ensureIndex() #3280
1983
19844.11.14 / 2017-09-30
1985====================
1986 * chore: add nsp check to the CI build #5679 [hairyhenderson](https://github.com/hairyhenderson)
1987 * fix: bump mquery because of security issue with debug package #5677 #5675 [jonathanprl](https://github.com/jonathanprl)
1988 * fix(populate): automatically select() populated()-ed fields #5669
1989 * fix(connection): make force close work as expected #5664
1990 * fix(document): treat $elemMatch as inclusive projection #5661
1991 * docs(model/query): clarify which functions fire which middleware #5654
1992 * fix(model): make `init()` public and return a promise that resolves when indexes are done building #5563
1993
19944.11.13 / 2017-09-24
1995====================
1996 * fix(query): correctly run replaceOne with update validators #5665 [sime1](https://github.com/sime1)
1997 * fix(schema): replace mistype in setupTimestamp method #5656 [zipp3r](https://github.com/zipp3r)
1998 * fix(query): avoid throwing cast error for strict: throw with nested id in query #5640
1999 * fix(model): ensure class gets combined schema when using class syntax with discriminators #5635
2000 * fix(document): handle setting doc array to array of top-level docs #5632
2001 * fix(model): handle casting findOneAndUpdate() with overwrite and upsert #5631
2002 * fix(update): correctly handle $ in updates #5628
2003 * fix(types): handle manual population consistently for unshift() and splice() #5504
2004
20054.11.12 / 2017-09-18
2006====================
2007 * docs(model): asterisk should not render as markdown bullet #5644 [timkinnane](https://github.com/timkinnane)
2008 * docs: use useMongoClient in connection example #5627 [GabrielNicolasAvellaneda](https://github.com/GabrielNicolasAvellaneda)
2009 * fix(connection): call callback when initial connection failed #5626
2010 * fix(query): apply select correctly if a given nested schema is used for 2 different paths #5603
2011 * fix(document): add graceful fallback for setting a doc array value and `pull()`-ing a doc #3511
2012
20134.11.11 / 2017-09-10
2014====================
2015 * fix(connection): properly set readyState in response to driver 'close' and 'reconnect' events #5604
2016 * fix(document): ensure single embedded doc setters only get called once, with correct value #5601
2017 * fix(timestamps): allow enabling updatedAt without createdAt #5598
2018 * test: improve unique validator test by making create run before ensureIndex #5595 #5562
2019 * fix(query): ensure find callback only gets called once when post init hook throws error #5592
2020
20214.11.10 / 2017-09-03
2022====================
2023 * docs: add KeenIO tracking #5612
2024 * fix(schema): ensure validators declared with `.validate()` get copied with clone() #5607
2025 * fix: remove unnecessary jest warning #5480
2026 * fix(discriminator): prevent implicit discriminator schema id from clobbering base schema custom id #5591
2027 * fix(schema): hide schema objectid warning for non-hex strings of length 24 #5587
2028 * docs(populate): use story schema defined key author instead of creator #5578 [dmric](https://github.com/dmric)
2029 * docs(document): describe usage of `.set()` #5576
2030 * fix(document): ensure correct scope in single nested validators #5569
2031 * fix(populate): don't mark path as populated until populate() is done #5564
2032 * fix(document): make push()-ing a doc onto an empty array act as manual population #5504
2033 * fix(connection): emit timeout event on socket timeout #4513
2034
20354.11.9 / 2017-08-27
2036===================
2037 * fix(error): avoid using arguments.callee because that breaks strict mode #5572
2038 * docs(schematypes): fix spacing #5567
2039 * fix(query): enforce binary subtype always propagates to mongodb #5551
2040 * fix(query): only skip castForQuery for mongoose arrays #5536
2041 * fix(browser): rely on browser entrypoint to decide whether to use BrowserDocument or NodeDocument #5480
2042
20434.11.8 / 2017-08-23
2044===================
2045 * feat: add warning about using schema ObjectId as type ObjectId #5571 [efkan](https://github.com/efkan)
2046 * fix(schema): allow setting `id` property after schema was created #5570 #5548
2047 * docs(populate): remove confusing _ from populate docs #5560
2048 * fix(connection): expose parsed uri fields (host, port, dbname) when using openUri() #5556
2049 * docs: added type boolean to options documentation #5547 [ndabAP](https://github.com/ndabAP)
2050 * test: add test coverage for stopping/starting server #5524
2051 * fix(aggregate): pull read preference from schema by default #5522
2052
20534.11.7 / 2017-08-14
2054===================
2055 * fix: correct properties when calling toJSON() on populated virtual #5544 #5442 [davidwu226](https://github.com/davidwu226)
2056 * docs: fix spelling #5535 [et](https://github.com/et)
2057 * fix(error): always set name before stack #5533
2058 * fix: add warning about running jest in jsdom environment #5532 #5513 #4943
2059 * fix(document): ensure overwriting a doc array cleans out individual docs #5523
2060 * fix(schema): handle creating arrays of single nested using type key #5521
2061 * fix: upgrade mongodb -> 2.2.31 to support user/pass options #5419
2062
20634.11.6 / 2017-08-07
2064===================
2065 * fix: limiting number of async operations per time in insertMany #5529 [andresattler](https://github.com/andresattler)
2066 * fix: upgrade mongodb -> 2.2.30 #5517
2067 * fix(browserDocument): prevent stack overflow caused by double-wrapping embedded doc save() in jest #5513
2068 * fix(document): clear single nested doc when setting to empty object #5506
2069 * fix(connection): emit reconnected and disconnected events correctly with useMongoClient #5498
2070 * fix(populate): ensure nested virtual populate gets set even if top-level property is null #5431
2071
20724.11.5 / 2017-07-30
2073===================
2074 * docs: fix link to $lookup #5516 [TalhaAwan](https://github.com/TalhaAwan)
2075 * fix: better parallelization for eachAsync #5502 [lchenay](https://github.com/lchenay)
2076 * docs(document): copy docs for save from model to doc #5493
2077 * fix(document): handle dotted virtuals in toJSON output #5473
2078 * fix(populate): restore user-provided limit after mutating so cursor() works with populate limit #5468
2079 * fix(query): don't throw StrictModeError if geo query with upsert #5467
2080 * fix(populate): propagate readPreference from query to populate queries by default #5460
2081 * docs: warn not to use arrow functions for statics and methods #5458
2082 * fix(query): iterate over all condition keys for setDefaultsOnInsert #5455
2083 * docs(connection): clarify server/replset/mongos option deprecation with useMongoClient #5442
2084
20854.11.4 / 2017-07-23
2086===================
2087 * fix: handle next() errors in `eachAsync()` #5486 [lchenay](https://github.com/lchenay)
2088 * fix(schema): propagate runSettersOnQuery option to implicitly created schemas #5479 [https://github.com/ValYouW]
2089 * fix(query): run castConditions() correctly in update ops #5477
2090 * fix(query): ensure castConditions called for findOne and findOneAnd* #5477
2091 * docs: clarify relationship between $lookup and populate #5475 [TalhaAwan](https://github.com/TalhaAwan)
2092 * test: add coverage for arrays of arrays [zbjornson](https://github.com/zbjornson)
2093 * fix(middleware): ensure that error handlers for save get doc as 2nd param #5466
2094 * fix: handle strict: false correctly #5454 #5453 [wookieb](https://github.com/wookieb)
2095 * fix(query): apply schema excluded paths if only projection is a $slice #5450
2096 * fix(query): correct discriminator handling for schema `select: false` fields in schema #5448
2097 * fix(cursor): call next() in series when parallel option used #5446
2098 * chore: load bundled driver first to avoid packaging problem #5443 [prototypeme](https://github.com/prototypeme)
2099 * fix(query): defer condition casting until final exec #5434
2100 * fix(aggregate): don't rely on mongodb aggregate to put a cursor in the callback #5394
2101 * docs(aggregate): add useMongooseAggCursor docs #5394
2102 * docs(middleware): clarify context for document, query, and model middleware #5381
2103
21044.11.3 / 2017-07-14
2105===================
2106 * fix(connection): remove .then() before resolving to prevent infinite recursion #5471
2107
21084.11.2 / 2017-07-13
2109===================
2110 * docs: fix comment typo in connect example #5435 [ConnorMcF](https://github.com/ConnorMcF)
2111 * fix(update): correctly cast document array in update validators with exec() #5430
2112 * fix(connection): handle autoIndex with useMongoClient #5423
2113 * fix(schema): handle `type: [Array]` in schemas #5416
2114 * fix(timestamps): if overwrite is set and there's a $set, use $set instead of top-level update #5413
2115 * fix(document): don't double-validate deeply nested doc array elements #5411
2116 * fix(schematype): clone default objects so default not shared across object instances unless `shared` specified #5407
2117 * fix(document): reset down the nested subdocs when resetting parent doc #5406
2118 * fix: don't pass error arg twice to error handlers #5405
2119 * fix(connection): make openUri() return connection decorated with then() and catch() #5404
2120 * fix: enforce $set on an array must be an array #5403
2121 * fix(document): don't crash if calling `validateSync()` after overwriting doc array index #5389
2122 * fix(discriminator): ensure discriminator key doesn't count as user-selected field for projection #4629
2123
21244.11.1 / 2017-07-02
2125===================
2126* docs: populate virtuals fix justOne description #5427 [fredericosilva](https://github.com/fredericosilva)
2127 * fix(connection): make sure to call onOpen in openUri() #5404
2128 * docs(query): justOne is actually single, and it default to false #5402 [zbjornson](https://github.com/zbjornson)
2129 * docs: fix small typo in lib/schema.js #5398 #5396 [pjo336](https://github.com/pjo336)
2130 * fix: emit remove on single nested subdocs when removing parent #5388
2131 * fix(update): handle update with defaults and overwrite but no update validators #5384
2132 * fix(populate): handle undefined refPath values in middle of array #5377
2133 * fix(document): ensure consistent setter context for single nested #5363
2134 * fix(query): support runSettersOnQuery as query option #5350
2135
21364.11.0 / 2017-06-25
2137===================
2138 * feat(query): execute setters with query as context for `runSettersOnQuery` #5339
2139 * feat(model): add translateAliases function #5338 [rocketspacer](https://github.com/rocketspacer)
2140 * feat(connection): add `useMongoClient` and `openUri` functions, deprecate current connect logic #5304
2141 * refactor(schema): make id virtual not access doc internals #5279
2142 * refactor: handle non-boolean lean #5279
2143 * feat(cursor): add addCursorFlag() support to query and agg cursors #4814
2144 * feat(cursor): add parallel option to eachAsync #4244
2145 * feat(schema): allow setting custom error constructor for custom validators #4009
2146
21474.10.8 / 2017-06-21
2148===================
2149 * docs: fix small formatting typo on schematypes #5374 [gianpaj](https://github.com/gianpaj)
2150 * fix(model): allow null as an _id #5370
2151 * fix(populate): don't throw async uncaught exception if model not found in populate #5364
2152 * fix: correctly cast decimals in update #5361
2153 * fix(error): don't use custom getter for ValidationError message #5359
2154 * fix(query): handle runSettersOnQuery in built-in _id setter #5351
2155 * fix(document): ensure consistent context for nested doc custom validators #5347
2156
21574.10.7 / 2017-06-18
2158===================
2159 * docs(validation): show overriding custom validator error with 2nd cb arg #5358
2160 * fix: `parseOption` mutates user passed option map #5357 [igwejk](https://github.com/igwejk)
2161 * docs: fix guide.jade typo #5356 [CalebAnderson2014](https://github.com/CalebAnderson2014)
2162 * fix(populate): don't set populate virtual to ids when match fails #5336
2163 * fix(query): callback with cast error if remove and delete* args have a cast error #5323
2164
21654.10.6 / 2017-06-12
2166===================
2167 * fix(cursor): handle custom model option for populate #5334
2168 * fix(populate): handle empty virtual populate with Model.populate #5331
2169 * fix(model): make ensureIndexes() run with autoIndex: false unless called internally #5328 #5324 #5317
2170 * fix: wait for all connections to close before resolving disconnect() promise #5316
2171 * fix(document): handle setting populated path with custom typeKey in schema #5313
2172 * fix(error): add toJSON helper to ValidationError so `message` shows up with JSON.stringify #5309
2173 * feat: add `getPromiseConstructor()` to prevent need for `mongoose.Promise.ES6` #5305
2174 * fix(document): handle conditional required with undefined props #5296
2175 * fix(model): clone options before inserting in save() #5294
2176 * docs(populate): clarify that multiple populate() calls on same path overwrite #5274
2177
21784.10.5 / 2017-06-06
2179===================
2180 * chore: improve contrib guide for building docs #5312
2181 * fix(populate): handle init-ing nested virtuals properly #5311
2182 * fix(update): report update validator error if required path under single nested doc not set
2183 * fix(schema): remove default validate pre hook that was causing issues with jest #4943
2184
21854.10.4 / 2017-05-29
2186===================
2187 * chore: dont store test data in same directory #5303
2188 * chore: add data dirs to npmignore #5301 [Starfox64](https://github.com/Starfox64)
2189 * docs(query): add docs about runSettersOnQuery #5300
2190
21914.10.3 / 2017-05-27
2192===================
2193 * docs: correct inconsistent references to updateOne and replaceOne #5297 [dhritzkiv](https://github.com/dhritzkiv)
2194 * docs: fix dropdowns in docs #5292 [nathanallen](https://github.com/nathanallen)
2195 * docs: add description of alias option #5287
2196 * fix(document): prevent infinite loop if validating nested array #5282
2197 * fix(schema): correctly handle ref ObjectIds from different mongoose libs #5259
2198 * fix(schema): load child class methods after base class methods to allow override #5227
2199
22004.10.2 / 2017-05-22
2201===================
2202 * fix: bump ms -> 2.0.0 and mquery -> 2.3.1 for minor security vulnerability #5275
2203
22044.10.1 / 2017-05-21
2205===================
2206 * fix(aggregate): handle sorting by text score correctly #5258
2207 * fix(populate): handle doc.populate() with virtuals #5240
2208 * fix(schema): enforce that `_id` is never null #5236
2209
22104.10.0 / 2017-05-18
2211===================
2212 * fix(schema): update clone method to include indexes #5268 [clozanosanchez](https://github.com/clozanosanchez)
2213 * feat(schema): support aliases #5184 [rocketspacer](https://github.com/rocketspacer)
2214 * feat(aggregate): add mongoose-specific aggregation cursor option #5145
2215 * refactor(model): make sharding into a plugin instead of core #5105
2216 * fix(document): make nested doc mongoose internals not enumerable again #5078
2217 * feat(model): pass params to pre hooks #5064
2218 * feat(timestamps): support already defined timestamp paths in schema #4868
2219 * feat(query): add runSettersOnQuery option #4569
2220 * fix(query): add strictQuery option that throws when not querying on field not in schema #4136
2221 * fix(update): more complete handling for overwrite option with update validators #3556
2222 * feat: support `unique: true` in arrays via the mongoose-unique-array plugin #3347
2223 * fix(model): always emit 'index', even if no indexes #3347
2224 * fix(schema): set unique indexes on primitive arrays #3347
2225 * feat(validation): include failed paths in error message and inspect output #3064 #2135
2226 * fix(model): return saved docs when create() fails #2190
2227
22284.9.10 / 2017-05-17
2229===================
2230 * fix(connection): ensure callback arg to openSet() is handled properly #5249
2231 * docs: remove dead plugins repo and add content links #5247
2232 * fix(model): skip index build if connecting after model init and autoIndex false #5176
2233
22344.9.9 / 2017-05-13
2235==================
2236 * docs: correct value for Query#regex() #5230
2237 * fix(connection): don't throw if .catch() on open() promise #5229
2238 * fix(schema): allow update with $currentDate for updatedAt to succeed #5222
2239 * fix(model): versioning doesn't fail if version key undefined #5221 [basileos](https://github.com/basileos)
2240 * fix(document): don't emit model error if callback specified for consistency with docs #5216
2241 * fix(document): handle errors in subdoc pre validate #5215
2242
22434.9.8 / 2017-05-07
2244==================
2245 * docs(subdocs): rewrite subdocs guide #5217
2246 * fix(document): avoid circular JSON if error in doc array under single nested subdoc #5208
2247 * fix(document): set intermediate empty objects for deeply nested undefined paths before path itself #5206
2248 * fix(schema): throw error if first param to schema.plugin() is not a function #5201
2249 * perf(document): major speedup in validating subdocs (50x in some cases) #5191
2250
22514.9.7 / 2017-04-30
2252==================
2253 * docs: fix typo #5204 [phutchins](https://github.com/phutchins)
2254 * fix(schema): ensure correct path for deeply nested schema indexes #5199
2255 * fix(schema): make remove a reserved name #5197
2256 * fix(model): handle Decimal type in insertMany correctly #5190
2257 * fix: upgrade kareem to handle async pre hooks correctly #5188
2258 * docs: add details about unique not being a validator #5179
2259 * fix(validation): handle returning a promise with isAsync: true #5171
2260
22614.9.6 / 2017-04-23
2262==================
2263 * fix: update `parentArray` references when directly assigning document arrays #5192 [jhob](https://github.com/jhob)
2264 * docs: improve schematype validator docs #5178 [milesbarr](https://github.com/milesbarr)
2265 * fix(model): modify discriminator() class in place #5175
2266 * fix(model): handle bulkWrite updateMany casting #5172 [tzellman](https://github.com/tzellman)
2267 * docs(model): fix replaceOne example for bulkWrite #5168
2268 * fix(document): don't create a new array subdoc when creating schema array #5162
2269 * fix(model): merge query hooks from discriminators #5147
2270 * fix(document): add parent() function to subdocument to match array subdoc #5134
2271
22724.9.5 / 2017-04-16
2273==================
2274 * fix(query): correct $pullAll casting of null #5164 [Sebmaster](https://github.com/Sebmaster)
2275 * docs: add advanced schemas docs for loadClass #5157
2276 * fix(document): handle null/undefined gracefully in applyGetters() #5143
2277 * fix(model): add resolveToObject option for mapReduce with ES6 promises #4945
2278
22794.9.4 / 2017-04-09
2280==================
2281 * fix(schema): clone query middleware correctly #5153 #5141 [clozanosanchez](https://github.com/clozanosanchez)
2282 * docs(aggregate): fix typo #5142
2283 * fix(query): cast .$ update to underlying array type #5130
2284 * fix(populate): don't mutate populate result in place #5128
2285 * fix(query): handle $setOnInsert consistent with $set #5126
2286 * docs(query): add strict mode option for findOneAndUpdate #5108
2287
22884.9.3 / 2017-04-02
2289==================
2290 * docs: document.js fixes for functions prepended with `$` #5131 [krmannix](https://github.com/krmannix)
2291 * fix: Avoid exception on constructor check #5129 [monkbroc](https://github.com/monkbroc)
2292 * docs(schematype): explain how to use `isAsync` with validate() #5125
2293 * docs(schematype): explain custom message with required function #5123
2294 * fix(populate): only apply refPath duplicate id optimization if not array #5114
2295 * fix(document): copy non-objects to doc when init() #5111
2296 * perf(populate): dont clone whole options every time #5103
2297 * feat(document): add isDirectSelected() to minimize isSelected() changes #5063
2298 * docs(schematypes): explain some subtleties with arrays #5059
2299
23004.9.2 / 2017-03-26
2301==================
2302 * fix(discriminator): handle class names consistently #5104
2303 * fix(schema): make clone() work with reusing discriminator schemas #5098
2304 * fix(querycursor): run pre find hooks with .cursor() #5096
2305 * fix(connection): throw error if username:password includes @ or : #5091
2306 * fix(timestamps): handle overwriting createdAt+updatedAt consistently #5088
2307 * fix(document): ensure subdoc post save runs after parent save #5085
2308 * docs(model): improve update docs #5076 [bertolo1988](https://github.com/bertolo1988)
2309
23104.9.1 / 2017-03-19
2311==================
2312 * fix(query): handle $type for arrays #5080 #5079 [zoellner](https://github.com/zoellner)
2313 * fix(model): handle ordered param for `insertMany` validation errors #5072 [sjorssnoeren](https://github.com/sjorssnoeren)
2314 * fix(populate): avoid duplicate ids in dynref queries #5054
2315 * fix(timestamps): dont set timestamps in update if user set it #5045
2316 * fix(update): dont double-call setters on arrays #5041
2317 * fix: upgrade driver -> 2.2.25 for jest fix #5033
2318 * fix(model): get promise each time save() is called rather than once #5030
2319 * fix(connection): make connect return value consistent #5006
2320
23214.9.0 / 2017-03-13
2322==================
2323 * feat(document): return this from `depopulate()` #5027
2324 * fix(drivers): stop emitting timeouts as errors #5026
2325 * feat(schema): add a clone() function for schemas #4983
2326 * feat(query): add rawResult option to replace passRawResult, deprecate passRawResult #4977 #4925
2327 * feat(schematype): support isAsync validator option and handle returning promises from validators, deprecate implicit async validators #4290
2328 * feat(query): add `replaceOne()`, `deleteOne()`, `deleteMany()` #3998
2329 * feat(model): add `bulkWrite()` #3998
2330
23314.8.7 / 2017-03-12
2332==================
2333 * fix(model): if last arg in spread is falsy, treat it as a callback #5061
2334 * fix(document): use $hook instead of hook to enable 'hook' as a path name #5047
2335 * fix(populate): dont select foreign field if parent field is selected #5037
2336 * fix(populate): handle passing no args to query.populate #5036
2337 * fix(update): use correct method for casting nested arrays #5032
2338 * fix(discriminator): handle array discriminators when casting $push #5009
2339
23404.8.6 / 2017-03-05
2341==================
2342 * docs(document): remove text that implies that transform is false by default #5023
2343 * fix(applyHooks): dont wrap a function if it is already wrapped #5019
2344 * fix(document): ensure nested docs' toObject() clones #5008
2345
23464.8.5 / 2017-02-25
2347==================
2348 * fix: check for empty schemaPath before accessing property $isMongooseDocumentArray #5017 [https://github.com/randyhoulahan](randyhoulahan)
2349 * fix(discriminators): handle create() and push() for embedded discriminators #5001
2350 * fix(querycursor): ensure close emitted after last data event #4998
2351 * fix(discriminators): remove fields not selected in child when querying by base model #4991
2352
23534.8.4 / 2017-02-19
2354==================
2355 * docs(discriminators): explain embedded discriminators #4997
2356 * fix(query): fix TypeError when findOneAndUpdate errors #4990
2357 * fix(update): handle nested single embedded in update validators correctly #4989
2358 * fix(browser): make browser doc constructor not crash #4987
2359
23604.8.3 / 2017-02-15
2361==================
2362 * chore: upgrade mongodb driver -> 2.2.24
2363 * docs(connections): addd some details about callbacks #4986
2364 * fix: ensure class is created with new keyword #4972 #4947 [benhjames](https://github.com/benhjames)
2365 * fix(discriminator): add applyPluginsToDiscriminators option #4965
2366 * fix(update): properly cast array subdocs when casting update #4960
2367 * fix(populate): ensure foreign field is selected for virtual populate #4959
2368 * docs(query): document some query callback params #4949
2369 * fix(document): ensure errors in validators get caught #2185
2370
23714.8.2 / 2017-02-10
2372==================
2373 * fix(update): actually run validators on addToSet #4953
2374 * fix(update): improve buffer error handling #4944 [ValYouW](https://github.com/ValYouW)
2375 * fix(discriminator): handle subclassing with loadClass correctly #4942
2376 * fix(query): allow passing Map to sort() #4941
2377 * fix(document): handle setting discriminator doc #4935
2378 * fix(schema): return correct value from pre init hook #4928
2379 * fix(query): ensure consistent params in error handlers if pre hook errors #4927
2380
23814.8.1 / 2017-01-30
2382==================
2383 * fix(query): handle $exists for arrays and embedded docs #4937
2384 * fix(query): handle passing string to hint() #4931
2385
23864.8.0 / 2017-01-28
2387==================
2388 * feat(schema): add saveErrorIfNotFound option and $where property #4924 #4004
2389 * feat(query): add $in implicitly if passed an array #4912 [QuotableWater7](https://github.com/QuotableWater7)
2390 * feat(aggregate): helper for $facet #4904 [varunjayaraman](https://github.com/varunjayaraman)
2391 * feat(query): add collation method #4839
2392 * feat(schema): propogate strict option to implicit array subschemas #4831 [dkrosso](https://github.com/dkrosso)
2393 * feat(aggregate): add helper for graphLookup #4819 [varunjayaraman](https://github.com/varunjayaraman)
2394 * feat(types): support Decimal128 #4759
2395 * feat(aggregate): add eachAsync() to aggregate cursor #4300
2396 * feat(query): add updateOne and updateMany #3997
2397 * feat(model): support options for insertMany #3893
2398 * fix(document): run validation on single nested docs if not directly modified #3884
2399 * feat(model): use discriminator constructor based on discriminatorKey in create() #3624
2400 * feat: pass collection as context to debug function #3261
2401 * feat(query): support push and addToSet for update validators #2933
2402 * perf(document): refactor registerHooksFromSchema so hooks are defined on doc prototype #2754
2403 * feat(types): add discriminator() function to doc arrays #2723 #1856
2404 * fix(populate): return an error if sorting underneath a doc array #2202
2405
24064.7.9 / 2017-01-27
2407==================
2408 * fix(query): handle casting $exists under $not #4933
2409 * chore: upgrade mongodb -> 2.2.22 re: #4931
2410
24114.7.8 / 2017-01-23
2412==================
2413 * fix(populate): better handling for virtual populate under arrays #4923
2414 * docs: upgrade contributors count #4918 [AdamZaczek](https://github.com/AdamZaczek)
2415 * fix(query): don't set nested path default if setting parent path #4911
2416 * docs(promise): add missing bracket #4907
2417 * fix(connection): ensure error handling is consistently async #4905
2418 * fix: handle authMechanism in query string #4900
2419 * fix(document): ensure error handlers run for validate #4885
2420
24214.7.7 / 2017-01-15
2422==================
2423 * fix(utils): don't crash if to[key] is null #4881
2424 * fix: upgrade mongodb -> 2.2.21 #4867
2425 * fix: add a toBSON to documents for easier querying #4866
2426 * fix: suppress bluebird warning #4854 [davidwu226](https://github.com/davidwu226)
2427 * fix(populate): handle nested virtuals in virtual populate #4851
2428
24294.7.6 / 2017-01-02
2430==================
2431 * fix(model): allow passing non-array to insertMany #4846
2432 * fix(populate): use base model name if no discriminator for backwards compat #4843
2433 * fix: allow internal validate callback to be optional #4842 [arciisine](https://github.com/arciisine)
2434 * fix(document): don't skip pointCut if save not defined (like in browser doc) #4841
2435 * chore: improve benchmarks #4838 [billouboq](https://github.com/billouboq)
2436 * perf: remove some unused parameters #4837 [billouboq](https://github.com/billouboq)
2437 * fix(query): don't call error handler if passRawResult is true and no error occurred #4836
2438
24394.7.5 / 2016-12-26
2440==================
2441 * docs(model): fix spelling mistake #4828 [paulinoj](https://github.com/paulinoj)
2442 * fix(aggregate): remove unhandled rejection when using aggregate.then() #4824
2443 * perf: remove try/catch that kills optimizer #4821
2444 * fix(model): handles populating with discriminators that may not have a ref #4817
2445 * fix(document): handle setting array of discriminators #3575
2446
24474.7.4 / 2016-12-21
2448==================
2449 * docs: fix typo #4810 [GEEKIAM](https://github.com/GEEKIAM)
2450 * fix(query): timestamps with $push + $each #4805
2451 * fix(document): handle buffers correctly in minimize #4800
2452 * fix: don't disallow overwriting default and cast fns #4795 [pdspicer](https://github.com/pdspicer)
2453 * fix(document): don't convert single nested docs to POJOs #4793
2454 * fix(connection): handle reconnect to replica set correctly #4972 [gfzabarino](https://github.com/gfzabarino)
2455
24564.7.3 / 2016-12-16
2457==================
2458 * fix: upgrade mongodb driver -> 2.2.16 for several bug fixes and 3.4 support #4799
2459 * fix(model): ensure discriminator key is correct for child schema on discriminator #4790
2460 * fix(document): handle mark valid in subdocs correctly #4778
2461 * fix(query): check for objects consistently #4775
2462
24634.7.2 / 2016-12-07
2464==================
2465 * test(populate): fix justOne test #4772 [cblanc](https://github.com/cblanc)
2466 * chore: fix benchmarks #4769 [billouboq](https://github.com/billouboq)
2467 * fix(document): handle setting subdoc to null after setting parent doc #4766
2468 * fix(query): support passRawResult with lean #4762 #4761 [mhfrantz](https://github.com/mhfrantz)
2469 * fix(query): throw StrictModeError if upsert with nonexisting field in condition #4757
2470 * test: fix a couple of sort tests #4756 [japod](https://github.com/japod)
2471 * chore: upgrade mongodb driver -> 2.2.12 #4753 [mdlavin](https://github.com/mdlavin)
2472 * fix(query): handle update with upsert and overwrite correctly #4749
2473
24744.7.1 / 2016-11-30
2475==================
2476 * fix(schema): throw error if you use prototype as a schema path #4746
2477 * fix(schema): throw helpful error if you define a virtual with the same path as a real path #4744
2478 * fix(connection): make createConnection not throw rejected promises #4742
2479 * fix(populate): allow specifiying options in model schema #4741
2480 * fix(document): handle selected nested elements with defaults #4739
2481 * fix(query): add model to cast error if possible #4729
2482 * fix(query): handle timestamps with overwrite #4054
2483
24844.7.0 / 2016-11-23
2485==================
2486 * docs: clean up schematypes #4732 [kidlj](https://github.com/kidlj)
2487 * perf: only get stack when necessary with VersionError #4726 [Sebmaster](https://github.com/Sebmaster)
2488 * fix(query): ensure correct casting when setting array element #4724
2489 * fix(connection): ensure db name gets set when you pass 4 params #4721
2490 * fix: prevent TypeError in node v7 #4719 #4706
2491 * feat(document): support .set() on virtual subpaths #4716
2492 * feat(populate): support populate virtuals on nested schemas #4715
2493 * feat(querycursor): support transform option and .map() #4714 #4705 [cblanc](https://github.com/cblanc)
2494 * fix(document): dont set defaults on not-selected nested paths #4707
2495 * fix(populate): don't throw if empty string passed to populate #4702
2496 * feat(model): add `loadClass()` function for importing schema from ES6 class #4668 [rockmacaca](https://github.com/rockmacaca)
2497
24984.6.8 / 2016-11-14
2499==================
2500 * fix(querycursor): clear stack when iterating onto next doc #4697
2501 * fix: handle null keys in validation error #4693 #4689 [arciisine](https://github.com/arciisine)
2502 * fix(populate): handle pre init middleware correctly with populate virtuals #4683
2503 * fix(connection): ensure consistent return value for open and openSet #4659
2504 * fix(schema): handle falsy defaults for arrays #4620
2505
25064.6.7 / 2016-11-10
2507==================
2508 * fix(document): only invalidate in subdoc if using update validators #4681
2509 * fix(document): don't create subdocs when excluded in projection #4669
2510 * fix(document): ensure single embedded schema validator runs with correct context #4663
2511 * fix(document): make sure to depopulate top level for sharding #4658
2512 * fix(connection): throw more helpful error when .model() called incorrectly #4652
2513 * fix(populate): throw more descriptive error when trying to populate a virtual that doesn't have proper options #4602
2514 * fix(document): ensure subtype gets set properly when saving with a buffer id #4506
2515 * fix(query): handle setDefaultsOnInsert with defaults on doc arrays #4456
2516 * fix(drivers): make debug output better by calling toBSON() #4356
2517
25184.6.6 / 2016-11-03
2519==================
2520 * chore: upgrade deps #4674 [TrejGun](https://github.com/TrejGun)
2521 * chore: run tests on node v7 #4673 [TrejGun](https://github.com/TrejGun)
2522 * perf: make setDefaultsOnInsert more efficient if upsert is off #4672 [CamHenlin](https://github.com/CamHenlin)
2523 * fix(populate): ensure document array is returned #4656
2524 * fix(query): cast doc arrays with positionals correctly for update #4655
2525 * fix(document): ensure single nested doc validators run with correct context #4654
2526 * fix: handle reconnect failed error in new version of driver #4653 [loris](https://github.com/loris)
2527 * fix(populate): if setting a populated doc, take its id #4632
2528 * fix(populate): handle populated virtuals in init #4618
2529
25304.6.5 / 2016-10-23
2531==================
2532 * docs: fix grammar issues #4642 #4640 #4639 [silvermanj7](https://github.com/silvermanj7)
2533 * fix(populate): filter out nonexistant values for dynref #4637
2534 * fix(query): handle $type as a schematype operator #4632
2535 * fix(schema): better handling for uppercase: false and lowercase: false #4622
2536 * fix(query): don't run transforms on updateForExec() #4621
2537 * fix(query): handle id = 0 in findById #4610
2538 * fix(query): handle buffers in mergeClone #4609
2539 * fix(document): handle undefined with conditional validator for validateSync #4607
2540 * fix: upgrade to mongodb driver 2.2.11 #4581
2541 * docs(schematypes): clarify schema.path() #4518
2542 * fix(query): ensure path is defined before checking in timestamps #4514
2543 * fix(model): set version key in upsert #4505
2544 * fix(document): never depopulate top-level doc #3057
2545 * refactor: ensure sync for setting non-capped collections #2690
2546
25474.6.4 / 2016-10-16
2548==================
2549 * fix(query): cast $not correctly #4616 #4592 [prssn](https://github.com/prssn)
2550 * fix: address issue with caching global plugins #4608 #4601 [TrejGun](https://github.com/TrejGun)
2551 * fix(model): make sure to depopulate in insertMany #4590
2552 * fix(model): buffer autoIndex if bufferCommands disabled #4589
2553 * fix(populate): copy ids array before modifying #4585
2554 * feat(schema): add retainKeyOrder prop #4542
2555 * fix(document): return isModified true for children of direct modified paths #4528
2556 * fix(connection): add dropDatabase() helper #4490
2557 * fix(model): add usePushEach option for schemas #4455
2558 * docs(connections): add some warnings about buffering #4413
2559 * fix: add ability to set promise implementation in browser #4395
2560
25614.6.3 / 2016-10-05
2562==================
2563 * fix(document): ensure single nested docs get initialized correctly when setting nested paths #4578
2564 * fix: turn off transforms when writing nested docs to db #4574
2565 * fix(document): don't set single nested subdocs to null when removing parent doc #4566
2566 * fix(model): ensure versionKey gets set in insertMany #4561
2567 * fix(schema): handle typeKey in arrays #4548
2568 * feat(schema): set $implicitlyCreated on schema if created by interpretAsType #4443
2569
25704.6.2 / 2016-09-30
2571==================
2572 * chore: upgrade to async 2.0.1 internally #4579 [billouboq](https://github.com/billouboq)
2573 * fix(types): ensure nested single doc schema errors reach update validators #4557 #4519
2574 * fix(connection): handle rs names with leading numbers (muri 1.1.1) #4556
2575 * fix(model): don't throw if method name conflicts with Object.prototype prop #4551
2576 * docs: fix broken link #4544 [VFedyk](https://github.com/VFedyk)
2577 * fix: allow overwriting model on mongoose singleton #4541 [Nainterceptor](https://github.com/Nainterceptor)
2578 * fix(document): don't use init: true when building doc defaults #4540
2579 * fix(connection): use replSet option if replset not specified #4535
2580 * fix(query): cast $not objects #4495
2581
25824.6.1 / 2016-09-20
2583==================
2584 * fix(query): improve handling of $not with $elemMatch #4531 #3719 [timbowhite](https://github.com/timbowhite)
2585 * fix: upgrade mongodb -> 2.2.10 #4517
2586 * chore: fix webpack build issue #4512 [saiichihashimoto](https://github.com/saiichihashimoto)
2587 * fix(query): emit error on next tick when exec callback errors #4500
2588 * test: improve test case #4496 [isayme](https://github.com/isayme)
2589 * fix(schema): use same check for array types and top-level types #4493
2590 * style: fix indentation in docs #4489 [dhurlburtusa](https://github.com/dhurlburtusa)
2591 * fix(schema): expose original object passed to constructor #4486
2592 * fix(query): handle findOneAndUpdate with array of arrays #4484 #4470 [fedotov](https://github.com/fedotov)
2593 * feat(document): add $ignore to make a path ignored #4480
2594 * fix(query): properly handle setting single embedded in update #4475 #4466 #4465
2595 * fix(updateValidators): handle single nested schema subpaths correctly #4479
2596 * fix(model): throw handy error when method name conflicts with property name #4475
2597 * fix(schema): handle .set() with array field #4472
2598 * fix(query): check nested path when avoiding double-validating Mixed #4441
2599 * fix(schema): handle calling path.trim() with no args correctly #4042
2600
26014.6.0 / 2016-09-02
2602==================
2603 * docs(document): clarify the findById and findByIdAndUpdate examples #4471 [mdcanham](https://github.com/mdcanham)
2604 * docs(schematypes): add details re: options #4452
2605 * docs(middleware): add docs for insertMany hooks #4451
2606 * fix(schema): create new array when copying from existing object to preserve change tracking #4449
2607 * docs: fix typo in index.jade #4448
2608 * fix(query): allow array for populate options #4446
2609 * fix(model): create should not cause unhandle reject promise #4439
2610 * fix: upgrade to mongodb driver 2.2.9 #4363 #4341 #4311 (see [comments here](https://github.com/mongodb/js-bson/commit/aa0b54597a0af28cce3530d2144af708e4b66bf0#commitcomment-18850498) if you use node 0.10)
2611
26124.5.10 / 2016-08-23
2613===================
2614 * docs: fix typo on documents.jade #4444 [Gabri3l](https://github.com/Gabri3l)
2615 * chore: upgrade mocha to 3.0.2 #4437 [TrejGun](https://github.com/TrejGun)
2616 * fix: subdocuments causing error with parent timestamp on update #4434 [dyang108](https://github.com/dyang108)
2617 * fix(query): don't crash if timestamps on and update doesn't have a path #4425 #4424 #4418
2618 * fix(query): ensure single nested subdoc is hydrated when running update validators #4420
2619 * fix(query): cast non-$geometry operators for $geoWithin #4419
2620 * docs: update contributor count #4415 [AdamZaczek](https://github.com/AdamZaczek)
2621 * docs: add more clarification re: the index event #4410
2622 * fix(document): only skip modifying subdoc path if parent is direct modified #4405
2623 * fix(schema): throw cast error if provided date invalid #4404
2624 * feat(error): use util.inspect() so CastError never prints "[object Object]" #4398
2625 * fix(model): dont error if the discriminator key is unchanged #4387
2626 * fix(query): don't throw unhandled rejection with bluebird when using cbs #4379
2627
26284.5.9 / 2016-08-14
2629==================
2630 * docs: add mixed schema doc for Object literal #4400 [Kikobeats](https://github.com/Kikobeats)
2631 * fix(query): cast $geoWithin and convert mongoose objects to POJOs before casting #4392
2632 * fix(schematype): dont cast defaults without parent doc #4390
2633 * fix(query): disallow passing empty string to findOne() #4378
2634 * fix(document): set single nested doc isNew correctly #4369
2635 * fix(types): checks field name correctly with nested arrays and populate #4365
2636 * fix(drivers): make debug output copy-pastable into mongodb shell #4352
2637 * fix(services): run update validators on nested paths #4332
2638 * fix(model): handle typeKey with discriminators #4339
2639 * fix(query): apply timestamps to child schemas when explicitly specified in update #4049
2640 * fix(schema): set prefix as nested path with add() #1730
2641
26424.5.8 / 2016-08-01
2643==================
2644 * fix(model): make changing the discriminator key cause a cast error #4374
2645 * fix(query): pass projection fields to cursor #4371 #4342 [Corei13](https://github.com/Corei13)
2646 * fix(document): support multiple paths for isModified #4370 [adambuczynski](https://github.com/adambuczynski)
2647 * fix(querycursor): always cast fields before returning cursor #4355
2648 * fix(query): support projection as alias for fields in findOneAndUpdate #4315
2649 * fix(schema): treat index false + unique false as no index #4304
2650 * fix(types): dont mark single nested subpath as modified if whole doc already modified #4224
2651
26524.5.7 / 2016-07-25
2653==================
2654 * fix(document): ensure no unhandled rejections if callback specified for save #4364
2655
26564.5.6 / 2016-07-23
2657==================
2658 * fix(schema): don't overwrite createdAt if it isn't selected #4351 [tusbar](https://github.com/tusbar)
2659 * docs(api): fix link to populate() and add a new one from depopulate() #4345 [Delapouite](https://github.com/Delapouite)
2660 * fix(types): ownerDocument() works properly with single nested docs #4344 [vichle](https://github.com/vichle)
2661 * fix(populate): dont use findOne when justOne option set #4329
2662 * fix(document): dont trigger .then() deprecated warning when calling doc.remove() #4291
2663 * docs(connection): add promiseLibrary option #4280
2664 * fix(plugins): apply global plugins to subschemas #4271
2665 * fix(model): ensure `ensureIndex()` never calls back in the same tick #4246
2666 * docs(schema): improve post hook docs on schema #4238
2667
26684.5.5 / 2016-07-18
2669==================
2670 * fix(document): handle setting root to empty obj if minimize false #4337
2671 * fix: downgrade to mongodb 2.1.18 #4335 #4334 #4328 #4323
2672 * perf(types): remove defineProperty usage in documentarray #4333
2673 * fix(query): correctly pass model in .toConstructor() #4318
2674 * fix(services): avoid double-validating mixed types with update validators #4305
2675 * docs(middleware): add docs describing error handling middleware #4229
2676 * fix(types): throw correct error when invalidating doc array #3602
2677
26784.5.4 / 2016-07-11
2679==================
2680 * fix(types): fix removing embedded documents #4309 [RoCat](https://github.com/RoCat)
2681 * docs: various docs improvements #4302 #4294 [simonxca](https://github.com/simonxca)
2682 * fix: upgrade mongodb -> 2.1.21 #4295 #4202 [RoCat](https://github.com/RoCat)
2683 * fix(populate): convert single result to array for virtual populate because of lean #4288
2684 * fix(populate): handle empty results for populate virtuals properly #4285 #4284
2685 * fix(query): dont cast $inc to number if type is long #4283
2686 * fix(types): allow setting single nested doc to null #4281
2687 * fix(populate): handle deeply nested virtual populate #4278
2688 * fix(document): allow setting empty obj if strict mode is false #4274
2689 * fix(aggregate): allow passing obj to .unwind() #4239
2690 * docs(document): add return statements to transform examples #1963
2691
26924.5.3 / 2016-06-30
2693==================
2694 * fix(query): pass correct options to QueryCursor #4277 #4266
2695 * fix(querycursor): handle lean option correctly #4276 [gchudnov](https://github.com/gchudnov)
2696 * fix(document): fix error handling when no error occurred #4275
2697 * fix(error): use strict mode for version error #4272
2698 * docs(populate): fix crashing compilation for populate.jade #4267
2699 * fix(populate): support `justOne` option for populate virtuals #4263
2700 * fix(populate): ensure model param gets used for populate virtuals #4261 #4243
2701 * fix(querycursor): add ability to properly close the cursor #4258
2702 * docs(model): correct link to Document #4250
2703 * docs(populate): correct path for refPath populate #4240
2704 * fix(document): support validator.isEmail as validator #4064
2705
27064.5.2 / 2016-06-24
2707==================
2708 * fix(connection): add checks for collection presence for `onOpen` and `onClose` #4259 [nodkz](https://github.com/nodkz)
2709 * fix(cast): allow strings for $type operator #4256
2710 * fix(querycursor): support lean() #4255 [pyramation](https://github.com/pyramation)
2711 * fix(aggregate): allow setting noCursorTimeout option #4241
2712 * fix(document): handle undefined for Array.pull #4222 [Sebmaster](https://github.com/Sebmaster)
2713 * fix(connection): ensure promise.catch() catches initial connection error #4135
2714 * fix(document): show additional context for VersionError #2633
2715
27164.5.1 / 2016-06-18
2717==================
2718 * fix(model): ensure wrapped insertMany() returns a promise #4237
2719 * fix(populate): dont overwrite populateVirtuals when populating multiple paths #4234
2720 * docs(model): clarify relationship between create() and save() #4233
2721 * fix(types): handle option param in subdoc remove() #4231 [tdebarochez](https://github.com/tdebarochez)
2722 * fix(document): dedupe modified paths #4226 #4223 [adambuczynski](https://github.com/adambuczynski)
2723 * fix(model): don't modify user-provided options object #4221
2724 * fix(document): handle setting nested path to empty object #4218 #4182
2725 * fix(document): clean subpaths when removing single nested #4216
2726 * fix(document): don't force transform on subdocs with inspect #4213
2727 * fix(error): allow setting .messages object #4207
2728
27294.5.0 / 2016-06-13
2730==================
2731 * feat(query): added Query.prototype.catch() #4215 #4173 [adambuczynski](https://github.com/adambuczynski)
2732 * feat(query): add Query.prototype.cursor() as a .stream() alternative #4117 #3637 #1907
2733 * feat(document): add markUnmodified() function #4092 [vincentcr](https://github.com/vincentcr)
2734 * feat(aggregate): convert aggregate object to a thenable #3995 #3946 [megagon](https://github.com/megagon)
2735 * perf(types): remove defineProperties call for array (**Note:** Because of this, a mongoose array will no longer `assert.deepEqual()` a plain old JS array) #3886
2736 * feat(model): add hooks for insertMany() #3846
2737 * feat(schema): add support for custom query methods #3740 #2372
2738 * feat(drivers): emit error on 'serverClosed' because that means that reconnect failed #3615
2739 * feat(model): emit error event when callback throws exception #3499
2740 * feat(model): inherit options from discriminator base schema #3414 #1818
2741 * feat(populate): expose mongoose-populate-virtuals inspired populate API #2562
2742 * feat(document): trigger remove hooks on subdocs when removing parent #2348
2743 * feat(schema): add support for express-style error handling middleware #2284
2744 * fix(model): disallow setting discriminator key #2041
2745 * feat(schema): add support for nested arrays #1361
2746
27474.4.20 / 2016-06-05
2748===================
2749 * docs: clarify command buffering when using driver directly #4195
2750 * fix(promise): correct broken mpromise .catch() #4189
2751 * fix(document): clean modified subpaths when set path to empty obj #4182
2752 * fix(query): support minDistance with query casting and `.near()` #4179
2753 * fix(model): remove unnecessary .save() promise #4177
2754 * fix(schema): cast all valid ObjectId strings to object ids #3365
2755 * docs: remove unclear "unsafe" term in query docs #3282
2756
27574.4.19 / 2016-05-21
2758===================
2759 * fix(model): handle insertMany if timestamps not set #4171
2760
27614.4.18 / 2016-05-21
2762===================
2763 * docs: add missing period #4170 [gitname](https://github.com/gitname)
2764 * docs: change build badge to svg #4158 [a0viedo](https://github.com/a0viedo)
2765 * fix(model): update timestamps when setting `createdAt` #4155
2766 * fix(utils): make sure to require in document properly #4152
2767 * fix(model): throw overwrite error when discriminator name conflicts #4148
2768
27694.4.17 / 2016-05-13
2770===================
2771 * docs: remove repetition in QueryStream docs #4147 [hugoabonizio](https://github.com/hugoabonizio)
2772 * fix(document): dont double-validate doc array elements #4145
2773 * fix(document): call required function with correct scope #4142 [JedWatson](https://github.com/JedWatson)
2774
27754.4.16 / 2016-05-09
2776===================
2777 * refactor(document): use function reference #4133 [dciccale](https://github.com/dciccale)
2778 * docs(querystream): clarify `destroy()` and close event #4126 [AnthonyCC](https://github.com/AnthonyCC)
2779 * test: make before hook fail fast if it can't connect #4121
2780 * docs: add description of CastError constructor params #4120
2781 * fix(schematype): ensure single embedded defaults have $parent #4115
2782 * fix(document): mark nested paths for validation #4111
2783 * fix(schema): make sure element is always a subdoc in doc array validation #3816
2784
27854.4.15 / 2016-05-06
2786===================
2787 * fix(schema): support overwriting array default #4109
2788 * fix(populate): assign values when resolving each populate #4104
2789 * fix(aggregate): dont send async option to server #4101
2790 * fix(model): ensure isNew set to false after insertMany #4099
2791 * fix(connection): emit on error if listeners and no callback #4098
2792 * fix(document): treat required fn that returns false as required: false #4094
2793
27944.4.14 / 2016-04-27
2795===================
2796 * fix: upgrade mongodb -> 2.1.18 #4102
2797 * feat(connection): allow setting mongos as a uri query param #4093 #4035 [burtonjc](https://github.com/burtonjc)
2798 * fix(populate): make sure to use correct assignment order for each model #4073
2799 * fix(schema): add complete set of geospatial operators for single embedded subdocs #4014
2800
28013.8.40 / 2016-04-24
2802===================
2803 * upgraded; mquery -> 1.10.0 #3989
2804
28054.4.13 / 2016-04-21
2806===================
2807 * docs: add docs favicons #4082 [robertjustjones](https://github.com/robertjustjones)
2808 * docs(model): correct Model.remove() return value #4075 [Jokero](https://github.com/Jokero)
2809 * fix(query): add $geoWithin query casting for single embedded docs #4044
2810 * fix(schema): handle setting trim option to falsy #4042
2811 * fix(query): handle setDefaultsOnInsert with empty update #3835
2812
28134.4.12 / 2016-04-08
2814===================
2815 * docs(query): document context option for update and findOneAndUpdate #4055
2816 * docs(query): correct link to $geoWithin docs #4050
2817 * fix(project): upgrade to mongodb driver 2.1.16 #4048 [schmalliso](https://github.com/schmalliso)
2818 * docs(validation): fix validation docs #4028
2819 * fix(types): improve .id() check for document arrays #4011
2820 * fix(query): remove premature return when using $rename #3171
2821 * docs(connection): clarify relationship between models and connections #2157
2822
28234.4.11 / 2016-04-03
2824===================
2825 * fix: upgrade to mongodb driver 2.1.14 #4036 #4030 #3945
2826 * fix(connection): allow connecting with { mongos: true } to handle query params #4032 [burtonjc](https://github.com/burtonjc)
2827 * docs(connection): add autoIndex example #4026 [tilleps](https://github.com/tilleps)
2828 * fix(query): handle passRawResult option when zero results #4023
2829 * fix(populate): clone options before modifying #4022
2830 * docs: add missing whitespace #4019 [chenxsan](https://github.com/chenxsan)
2831 * chore: upgrade to ESLint 2.4.0 #4015 [ChristianMurphy](https://github.com/ChristianMurphy)
2832 * fix(types): single nested subdocs get ids by default #4008
2833 * chore(project): add dependency status badge #4007 [Maheshkumar-Kakade](http://github.com/Maheshkumar-Kakade)
2834 * fix: make sure timestamps don't trigger unnecessary updates #4005 #3991 [tommarien](https://github.com/tommarien)
2835 * fix(document): inspect inherits schema options #4001
2836 * fix(populate): don't mark populated path as modified if setting to object w/ same id #3992
2837 * fix(document): support kind argument to invalidate #3965
2838
28394.4.10 / 2016-03-24
2840===================
2841 * fix(document): copy isNew when copying a document #3982
2842 * fix(document): don't override defaults with undefined keys #3981
2843 * fix(populate): merge multiple deep populate options for the same path #3974
2844
28454.4.9 / 2016-03-22
2846==================
2847 * fix: upgrade mongodb -> 2.1.10 re https://jira.mongodb.org/browse/NODE-679 #4010
2848 * docs: add syntax highlighting for acquit examples #3975
2849
28504.4.8 / 2016-03-18
2851==================
2852 * docs(aggregate): clarify promises #3990 [megagon](https://github.com/megagon)
2853 * fix: upgrade mquery -> 1.10 #3988 [matskiv](https://github.com/matskiv)
2854 * feat(connection): 'all' event for repl sets #3986 [xizhibei](https://github.com/xizhibei)
2855 * docs(types): clarify Array.pull #3985 [seriousManual](https://github.com/seriousManual)
2856 * feat(query): support array syntax for .sort() via mquery 1.9 #3980
2857 * fix(populate): support > 3 level nested populate #3973
2858 * fix: MongooseThenable exposes connection correctly #3972
2859 * docs(connection): add note about reconnectTries and reconnectInterval #3969
2860 * feat(document): invalidate returns the new validationError #3964
2861 * fix(query): .eq() as shorthand for .equals #3953 [Fonger](https://github.com/Fonger)
2862 * docs(connection): clarify connection string vs passed options #3941
2863 * docs(query): select option for findOneAndUpdate #3933
2864 * fix(error): ValidationError.properties no longer enumerable #3925
2865 * docs(validation): clarify how required validators work with nested schemas #3915
2866 * fix: upgrade mongodb driver -> 2.1.8 to make partial index errors more sane #3864
2867
28684.4.7 / 2016-03-11
2869==================
2870 * fix(query): stop infinite recursion caused by merging a mongoose buffer #3961
2871 * fix(populate): handle deep populate array -> array #3954
2872 * fix(schema): allow setting timestamps with .set() #3952 #3951 #3907 [Fonger](https://github.com/Fonger)
2873 * fix: MongooseThenable doesn't overwrite constructors #3940
2874 * fix(schema): don't cast boolean to date #3935
2875 * fix(drivers): support sslValidate in connection string #3929
2876 * fix(types): correct markModified() for single nested subdocs #3910
2877 * fix(drivers): catch and report any errors that occur in driver methods #3906
2878 * fix(populate): get subpopulate model correctly when array under nested #3904
2879 * fix(document): allow fields named 'pre' and 'post' #3902
2880 * docs(query): clarify runValidators and setDefaultsOnInsert options #3892
2881 * docs(validation): show how to use custom required messages in schema #2616
2882
28834.4.6 / 2016-03-02
2884==================
2885 * fix: upgrade mongodb driver to 2.1.7 #3938
2886 * docs: fix plugins link #3917 #3909 [fbertone](https://github.com/fbertone)
2887 * fix(query): sort+select with count works #3914
2888 * fix(query): improve mergeUpdate's ability to handle nested docs #3890
2889
28904.4.5 / 2016-02-24
2891==================
2892 * fix(query): ability to select a length field (upgrade to mquery 1.7.0) #3903
2893 * fix: include nested CastError as reason for array CastError #3897 [kotarou3](https://github.com/kotarou3)
2894 * fix(schema): check for doc existence before taking fields #3889
2895 * feat(schema): useNestedStrict option to take nested strict mode for update #3883
2896 * docs(validation): clarify relationship between required and checkRequired #3822
2897 * docs(populate): dynamic reference docs #3809
2898 * docs: expand dropdown when clicking on file name #3807
2899 * docs: plugins.mongoosejs.io is up #3127
2900 * fix(schema): ability to add a virtual with same name as removed path #2398
2901
29024.4.4 / 2016-02-17
2903==================
2904 * fix(schema): handle field selection when casting single nested subdocs #3880
2905 * fix(populate): populating using base model with multiple child models in result #3878
2906 * fix: ability to properly use return value of `mongoose.connect()` #3874
2907 * fix(populate): dont hydrate populated subdoc if lean option set #3873
2908 * fix(connection): dont re-auth if already connected with useDb #3871
2909 * docs: cover how to set underlying driver's promise lib #3869
2910 * fix(document): handle conflicting names in validation errors with subdocs #3867
2911 * fix(populate): set undefined instead of null consistently when populate couldn't find results #3859
2912 * docs: link to `execPopulate()` in `doc.populate()` docs #3836
2913 * docs(plugin): link to the `mongoose.plugin()` function #3732
2914
29154.4.3 / 2016-02-09
2916==================
2917 * fix: upgrade to mongodb 2.1.6 to remove kerberos log output #3861 #3860 [cartuchogl](https://github.com/cartuchogl)
2918 * fix: require('mongoose') is no longer a pseudo-promise #3856
2919 * fix(query): update casting for single nested docs #3820
2920 * fix(populate): deep populating multiple paths with same options #3808
2921 * docs(middleware): clarify save/validate hook order #1149
2922
29234.4.2 / 2016-02-05
2924==================
2925 * fix(aggregate): handle calling .cursor() with no options #3855
2926 * fix: upgrade mongodb driver to 2.1.5 for GridFS memory leak fix #3854
2927 * docs: fix schematype.html conflict #3853 #3850 #3843
2928 * fix(model): bluebird unhandled rejection with ensureIndexes() on init #3837
2929 * docs: autoIndex option for createConnection #3805
2930
29314.4.1 / 2016-02-03
2932==================
2933 * fix: linting broke some cases where we use `== null` as shorthand #3852
2934 * docs: fix up schematype.html conflict #3848 #3843 [mynameiscoffey](https://github.com/mynameiscoffey)
2935 * fix: backwards breaking change with `.connect()` return value #3847
2936 * docs: downgrade dox and highlight.js to fix docs build #3845
2937 * docs: clean up typo #3842 [Flash-](https://github.com/Flash-)
2938 * fix(document): storeShard handles undefined values #3841
2939 * chore: more linting #3838 [TrejGun](https://github.com/TrejGun)
2940 * fix(schema): handle `text: true` as a way to declare a text index #3824
2941
29424.4.0 / 2016-02-02
2943==================
2944 * docs: fix expireAfterSeconds index option name #3831 [Flash-](https://github.com/Flash-)
2945 * chore: run lint after test #3829 [ChristianMurphy](https://github.com/ChristianMurphy)
2946 * chore: use power-assert instead of assert #3828 [TrejGun](https://github.com/TrejGun)
2947 * chore: stricter lint #3827 [TrejGun](https://github.com/TrejGun)
2948 * feat(types): casting moment to date #3813 [TrejGun](https://github.com/TrejGun)
2949 * chore: comma-last lint for test folder #3810 [ChristianMurphy](https://github.com/ChristianMurphy)
2950 * fix: upgrade async mpath, mpromise, muri, and sliced #3801 [TrejGun](https://github.com/TrejGun)
2951 * fix(query): geo queries now return proper ES2015 promises #3800 [TrejGun](https://github.com/TrejGun)
2952 * perf(types): use `Object.defineProperties()` for array #3799 [TrejGun](https://github.com/TrejGun)
2953 * fix(model): mapReduce, ensureIndexes, remove, and save properly return ES2015 promises #3795 #3628 #3595 [TrejGun](https://github.com/TrejGun)
2954 * docs: fixed dates in History.md #3791 [Jokero](https://github.com/Jokero)
2955 * feat: connect, open, openSet, and disconnect return ES2015 promises #3790 #3622 [TrejGun](https://github.com/TrejGun)
2956 * feat: custom type for int32 via mongoose-int32 npm package #3652 #3102
2957 * feat: basic custom schema type API #995
2958 * feat(model): `insertMany()` for more performant bulk inserts #723
2959
29604.3.7 / 2016-01-23
2961==================
2962 * docs: grammar fix in timestamps docs #3786 [zclancy](https://github.com/zclancy)
2963 * fix(document): setting nested populated docs #3783 [slamuu](https://github.com/slamuu)
2964 * fix(document): don't call post save hooks twice for pushed docs #3780
2965 * fix(model): handle `_id=0` correctly #3776
2966 * docs(middleware): async post hooks #3770
2967 * docs: remove confusing sentence #3765 [marcusmellis89](https://github.com/marcusmellis89)
2968
29693.8.39 / 2016-01-15
2970===================
2971 * fixed; casting a number to a buffer #3764
2972 * fixed; enumerating virtual property with nested objects #3743 [kusold](https://github.com/kusold)
2973
29744.3.6 / 2016-01-15
2975==================
2976 * fix(types): casting a number to a buffer #3764
2977 * fix: add "listener" to reserved keywords #3759
2978 * chore: upgrade uglify #3757 [ChristianMurphy](https://github.com/ChristianMurphy)
2979 * fix: broken execPopulate() in 4.3.5 #3755 #3753
2980 * fix: ability to remove() a single embedded doc #3754
2981 * style: comma-last in test folder #3751 [ChristianMurphy](https://github.com/ChristianMurphy)
2982 * docs: clarify versionKey option #3747
2983 * fix: improve colorization for arrays #3744 [TrejGun](https://github.com/TrejGun)
2984 * fix: webpack build #3713
2985
29864.3.5 / 2016-01-09
2987==================
2988 * fix(query): throw when 4th parameter to update not a function #3741 [kasselTrankos](https://github.com/kasselTrankos)
2989 * fix(document): separate error type for setting an object to a primitive #3735
2990 * fix(populate): Model.populate returns ES6 promise #3734
2991 * fix(drivers): re-register event handlers after manual reconnect #3729
2992 * docs: broken links #3727
2993 * fix(validation): update validators run array validation #3724
2994 * docs: clarify the need to use markModified with in-place date ops #3722
2995 * fix(document): mark correct path as populated when manually populating array #3721
2996 * fix(aggregate): support for array pipeline argument to append #3718 [dbkup](https://github.com/dbkup)
2997 * docs: clarify `.connect()` callback #3705
2998 * fix(schema): properly validate nested single nested docs #3702
2999 * fix(types): handle setting documentarray of wrong type #3701
3000 * docs: broken links #3700
3001 * fix(drivers): debug output properly displays '0' #3689
3002
30033.8.38 / 2016-01-07
3004===================
3005 * fixed; aggregate.append an array #3730 [dbkup](https://github.com/dbkup)
3006
30074.3.4 / 2015-12-23
3008==================
3009 * fix: upgrade mongodb driver to 2.1.2 for repl set error #3712 [sansmischevia](https://github.com/sansmischevia)
3010 * docs: validation docs typo #3709 [ivanmaeder](https://github.com/ivanmaeder)
3011 * style: remove unused variables #3708 [ChristianMurphy](https://github.com/ChristianMurphy)
3012 * fix(schema): duck-typing for schemas #3703 [mgcrea](https://github.com/mgcrea)
3013 * docs: connection sample code issue #3697
3014 * fix(schema): duck-typing for schemas #3693 [mgcrea](https://github.com/mgcrea)
3015 * docs: clarify id schema option #3638
3016
30174.3.3 / 2015-12-18
3018==================
3019 * fix(connection): properly support 'replSet' as well as 'replset' #3688 [taxilian](https://github.com/taxilian)
3020 * fix(document): single nested doc pre hooks called before nested doc array #3687 [aliatsis](https://github.com/aliatsis)
3021
30224.3.2 / 2015-12-17
3023==================
3024 * fix(document): .set() into single nested schemas #3686
3025 * fix(connection): support 'replSet' as well as 'replset' option #3685
3026 * fix(document): bluebird unhandled rejection when validating doc arrays #3681
3027 * fix(document): hooks for doc arrays in single nested schemas #3680
3028 * fix(document): post hooks for single nested schemas #3679
3029 * fix: remove unused npm module #3674 [sybarite](https://github.com/sybarite)
3030 * fix(model): don't swallow exceptions in nested doc save callback #3671
3031 * docs: update keepAlive info #3667 [ChrisZieba](https://github.com/ChrisZieba)
3032 * fix(document): strict 'throw' throws a specific mongoose error #3662
3033 * fix: flakey test #3332
3034 * fix(query): more robust check for RegExp #2969
3035
30364.3.1 / 2015-12-11
3037==================
3038 * feat(aggregate): `.sample()` helper #3665
3039 * fix(query): bitwise query operators with buffers #3663
3040 * docs(migration): clarify `new` option and findByIdAndUpdate #3661
3041
30424.3.0 / 2015-12-09
3043==================
3044 * feat(query): support for mongodb 3.2 bitwise query operators #3660
3045 * style: use comma-last style consistently #3657 [ChristianMurphy](https://github.com/ChristianMurphy)
3046 * feat: upgrade mongodb driver to 2.1.0 for full MongoDB 3.2 support #3656
3047 * feat(aggregate): `.lookup()` helper #3532
3048
30494.2.10 / 2015-12-08
3050===================
3051 * fixed; upgraded marked #3653 [ChristianMurphy](https://github.com/ChristianMurphy)
3052 * docs; cross-db populate #3648
3053 * docs; update mocha URL #3646 [ojhaujjwal](https://github.com/ojhaujjwal)
3054 * fixed; call close callback asynchronously #3645
3055 * docs; virtuals.html issue #3644 [Psarna94](https://github.com/Psarna94)
3056 * fixed; single embedded doc casting on init #3642
3057 * docs; validation docs improvements #3640
3058
30594.2.9 / 2015-12-02
3060==================
3061 * docs; defaults docs #3625
3062 * fix; nested numeric keys causing an embedded document crash #3623
3063 * fix; apply path getters before virtual getters #3618
3064 * fix; casting for arrays in single nested schemas #3616
3065
30664.2.8 / 2015-11-25
3067==================
3068 * docs; clean up README links #3612 [ReadmeCritic](https://github.com/ReadmeCritic)
3069 * fix; ESLint improvements #3605 [ChristianMurphy](https://github.com/ChristianMurphy)
3070 * fix; assigning single nested subdocs #3601
3071 * docs; describe custom logging functions in `mongoose.set()` docs #3557
3072
30734.2.7 / 2015-11-20
3074==================
3075 * fixed; readPreference connection string option #3600
3076 * fixed; pulling from manually populated arrays #3598 #3579
3077 * docs; FAQ about OverwriteModelError #3597 [stcruy](https://github.com/stcruy)
3078 * fixed; setting single embedded schemas to null #3596
3079 * fixed; indexes for single embedded schemas #3594
3080 * docs; clarify projection for `findOne()` #3593 [gunar](https://github.com/gunar)
3081 * fixed; .ownerDocument() method on single embedded schemas #3589
3082 * fixed; properly throw casterror for query on single embedded schema #3580
3083 * upgraded; mongodb driver -> 2.0.49 for reconnect issue fix #3481
3084
30854.2.6 / 2015-11-16
3086==================
3087 * fixed; ability to manually populate an array #3575
3088 * docs; clarify `isAsync` parameter to hooks #3573
3089 * fixed; use captureStackTrace if possible instead #3571
3090 * fixed; crash with buffer and update validators #3565 [johnpeb](https://github.com/johnpeb)
3091 * fixed; update casting with operators overwrite: true #3564
3092 * fixed; validation with single embedded docs #3562
3093 * fixed; inline docs inherit parents $type key #3560
3094 * docs; bad grammar in populate docs #3559 [amaurymedeiros](https://github.com/amaurymedeiros)
3095 * fixed; properly handle populate option for find() #2321
3096
30973.8.37 / 2015-11-16
3098===================
3099 * fixed; use retainKeyOrder for cloning update op #3572
3100
31014.2.5 / 2015-11-09
3102==================
3103 * fixed; handle setting fields in pre update hooks with exec #3549
3104 * upgraded; ESLint #3547 [ChristianMurphy](https://github.com/ChristianMurphy)
3105 * fixed; bluebird unhandled rejections with cast errors and .exec #3543
3106 * fixed; min/max validators handling undefined #3539
3107 * fixed; standalone mongos connections #3537
3108 * fixed; call `.toObject()` when setting a single nested doc #3535
3109 * fixed; single nested docs now have methods #3534
3110 * fixed; single nested docs with .create() #3533 #3521 [tusbar](https://github.com/tusbar)
3111 * docs; deep populate docs #3528
3112 * fixed; deep populate schema ref handling #3507
3113 * upgraded; mongodb driver -> 2.0.48 for sort overflow issue #3493
3114 * docs; clarify default ids for discriminators #3482
3115 * fixed; properly support .update(doc) #3221
3116
31174.2.4 / 2015-11-02
3118==================
3119 * fixed; upgraded `ms` package for security vulnerability #3524 [fhemberger](https://github.com/fhemberger)
3120 * fixed; ESlint rules #3517 [ChristianMurphy](https://github.com/ChristianMurphy)
3121 * docs; typo in aggregation docs #3513 [rafakato](https://github.com/rafakato)
3122 * fixed; add `dontThrowCastError` option to .update() for promises #3512
3123 * fixed; don't double-cast buffers in node 4.x #3510 #3496
3124 * fixed; population with single embedded schemas #3501
3125 * fixed; pre('set') hooks work properly #3479
3126 * docs; promises guide #3441
3127
31284.2.3 / 2015-10-26
3129==================
3130 * docs; remove unreferenced function in middleware.jade #3506
3131 * fixed; handling auth with no username/password #3500 #3498 #3484 [mleanos](https://github.com/mleanos)
3132 * fixed; more ESlint rules #3491 [ChristianMurphy](https://github.com/ChristianMurphy)
3133 * fixed; swallowing exceptions in save callback #3478
3134 * docs; fixed broken links in subdocs guide #3477
3135 * fixed; casting booleans to numbers #3475
3136 * fixed; report CastError for subdoc arrays in findOneAndUpdate #3468
3137 * fixed; geoNear returns ES6 promise #3458
3138
31394.2.2 / 2015-10-22
3140==================
3141 * fixed; go back to old pluralization code #3490
3142
31434.2.1 / 2015-10-22
3144==================
3145 * fixed; pluralization issues #3492 [ChristianMurphy](https://github.com/ChristianMurphy)
3146
31474.2.0 / 2015-10-22
3148==================
3149 * added; support for skipVersioning for document arrays #3467 [chazmo03](https://github.com/chazmo03)
3150 * added; ability to customize schema 'type' key #3459 #3245
3151 * fixed; writeConcern for index builds #3455
3152 * added; emit event when individual index build starts #3440 [objectiveSee](https://github.com/objectiveSee)
3153 * added; 'context' option for update validators #3430
3154 * refactor; pluralization now in separate pluralize-mongoose npm module #3415 [ChristianMurphy](https://github.com/ChristianMurphy)
3155 * added; customizable error validation messages #3406 [geronime](https://github.com/geronime)
3156 * added; support for passing 'minimize' option to update #3381
3157 * added; ability to customize debug logging format #3261
3158 * added; baseModelName property for discriminator models #3202
3159 * added; 'emitIndexErrors' option #3174
3160 * added; 'async' option for aggregation cursor to support buffering #3160
3161 * added; ability to skip validation for individual save() calls #2981
3162 * added; single embedded schema support #2689 #585
3163 * added; depopulate function #2509
3164
31654.1.12 / 2015-10-19
3166===================
3167 * docs; use readPreference instead of slaveOk for Query.setOptions docs #3471 [buunguyen](https://github.com/buunguyen)
3168 * fixed; more helpful error when regexp contains null bytes #3456
3169 * fixed; x509 auth issue #3454 [NoxHarmonium](https://github.com/NoxHarmonium)
3170
31713.8.36 / 2015-10-18
3172===================
3173 * fixed; Make array props non-enumerable #3461 [boblauer](https://github.com/boblauer)
3174
31754.1.11 / 2015-10-12
3176===================
3177 * fixed; update timestamps for update() if they're enabled #3450 [isayme](https://github.com/isayme)
3178 * fixed; unit test error on node 0.10 #3449 [isayme](https://github.com/isayme)
3179 * docs; timestamp option docs #3448 [isayme](https://github.com/isayme)
3180 * docs; fix unexpected indent #3443 [isayme](https://github.com/isayme)
3181 * fixed; use ES6 promises for Model.prototype.remove() #3442
3182 * fixed; don't use unused 'safe' option for index builds #3439
3183 * fixed; elemMatch casting bug #3437 #3435 [DefinitelyCarter](https://github.com/DefinitelyCarter)
3184 * docs; schema.index docs #3434
3185 * fixed; exceptions in save() callback getting swallowed on mongodb 2.4 #3371
3186
31874.1.10 / 2015-10-05
3188===================
3189 * docs; improve virtuals docs to explain virtuals schema option #3433 [zoyaH](https://github.com/zoyaH)
3190 * docs; MongoDB server version compatibility guide #3427
3191 * docs; clarify that findById and findByIdAndUpdate fire hooks #3422
3192 * docs; clean up Model.save() docs #3420
3193 * fixed; properly handle projection with just id #3407 #3412
3194 * fixed; infinite loop when database document is corrupted #3405
3195 * docs; clarify remove middleware #3388
3196
31974.1.9 / 2015-09-28
3198==================
3199 * docs; minlength and maxlength string validation docs #3368 #3413 [cosmosgenius](https://github.com/cosmosgenius)
3200 * fixed; linting for infix operators #3397 [ChristianMurphy](https://github.com/ChristianMurphy)
3201 * fixed; proper casting for $all #3394
3202 * fixed; unhandled rejection warnings with .create() #3391
3203 * docs; clarify update validators on paths that aren't explicitly set #3386
3204 * docs; custom validator examples #2778
3205
32064.1.8 / 2015-09-21
3207==================
3208 * docs; fixed typo in example #3390 [kmctown](https://github.com/kmctown)
3209 * fixed; error in toObject() #3387 [guumaster](https://github.com/guumaster)
3210 * fixed; handling for casting null dates #3383 [alexmingoia](https://github.com/alexmingoia)
3211 * fixed; passing composite ids to `findByIdAndUpdate` #3380
3212 * fixed; linting #3376 #3375 [ChristianMurphy](https://github.com/ChristianMurphy)
3213 * fixed; added NodeJS v4 to Travis #3374 [ChristianMurphy](https://github.com/ChristianMurphy)
3214 * fixed; casting $elemMatch inside of $not #3373 [gaguirre](https://github.com/gaguirre)
3215 * fixed; handle case where $slice is 0 #3369
3216 * fixed; avoid running getters if path is populated #3357
3217 * fixed; cast documents to objects when setting to a nested path #3346
3218
32194.1.7 / 2015-09-14
3220==================
3221 * docs; typos in SchemaType documentation #3367 [jasson15](https://github.com/jasson15)
3222 * fixed; MONGOOSE_DRIVER_PATH env variable again #3360
3223 * docs; added validateSync docs #3353
3224 * fixed; set findOne op synchronously in query #3344
3225 * fixed; handling for `.pull()` on a documentarray without an id #3341
3226 * fixed; use natural order for cloning update conditions #3338
3227 * fixed; issue with strict mode casting for mixed type updates #3337
3228
32294.1.6 / 2015-09-08
3230==================
3231 * fixed; MONGOOSE_DRIVER_PATH env variable #3345 [g13013](https://github.com/g13013)
3232 * docs; global autoIndex option #3335 [albertorestifo](https://github.com/albertorestifo)
3233 * docs; model documentation typos #3330
3234 * fixed; report reason for CastError #3320
3235 * fixed; .populate() no longer returns true after re-assigning #3308
3236 * fixed; discriminators with aggregation geoNear #3304
3237 * docs; discriminator docs #2743
3238
32394.1.5 / 2015-09-01
3240==================
3241 * fixed; document.remove() removing all docs #3326 #3325
3242 * fixed; connect() checks for rs_name in options #3299
3243 * docs; examples for schema.set() #3288
3244 * fixed; checkKeys issue with bluebird #3286 [gregthegeek](https://github.com/gregthegeek)
3245
32464.1.4 / 2015-08-31
3247==================
3248 * fixed; ability to set strict: false for update #3305
3249 * fixed; .create() properly uses ES6 promises #3297
3250 * fixed; pre hooks on nested subdocs #3291 #3284 [aliatsis](https://github.com/aliatsis)
3251 * docs; remove unclear text in .remove() docs #3282
3252 * fixed; pre hooks called twice for 3rd-level nested doc #3281
3253 * fixed; nested transforms #3279
3254 * upgraded; mquery -> 1.6.3 #3278 #3272
3255 * fixed; don't swallow callback errors by default #3273 #3222
3256 * fixed; properly get nested paths from nested schemas #3265
3257 * fixed; remove() with id undefined deleting all docs #3260 [thanpolas](https://github.com/thanpolas)
3258 * fixed; handling for non-numeric projections #3256
3259 * fixed; findById with id undefined returning first doc #3255
3260 * fixed; use retainKeyOrder for update #3215
3261 * added; passRawResult option to findOneAndUpdate for backwards compat #3173
3262
32634.1.3 / 2015-08-16
3264==================
3265 * fixed; getUpdate() in pre update hooks #3520 [gregthegeek](https://github.com/gregthegeek)
3266 * fixed; handleArray() ensures arg is an array #3238 [jloveridge](https://github.com/jloveridge)
3267 * fixed; refresh required path cache when recreating docs #3199
3268 * fixed; $ operator on unwind aggregation helper #3197
3269 * fixed; findOneAndUpdate() properly returns raw result as third arg to callback #3173
3270 * fixed; querystream with dynamic refs #3108
3271
32723.8.35 / 2015-08-14
3273===================
3274 * fixed; handling for minimize on nested objects #2930
3275 * fixed; don't crash when schema.path.options undefined #1824
3276
32774.1.2 / 2015-08-10
3278==================
3279 * fixed; better handling for Jade templates #3241 [kbadk](https://github.com/kbadk)
3280 * added; ESlint trailing spaces #3234 [ChristianMurphy](https://github.com/ChristianMurphy)
3281 * added; ESlint #3191 [ChristianMurphy](https://github.com/ChristianMurphy)
3282 * fixed; properly emit event on disconnect #3183
3283 * fixed; copy options properly using Query.toConstructor() #3176
3284 * fixed; setMaxListeners() issue in browser build #3170
3285 * fixed; node driver -> 2.0.40 to not store undefined keys as null #3169
3286 * fixed; update validators handle positional operator #3167
3287 * fixed; handle $all + $elemMatch query casting #3163
3288 * fixed; post save hooks don't swallow extra args #3155
3289 * docs; spelling mistake in index.jade #3154
3290 * fixed; don't crash when toObject() has no fields #3130
3291 * fixed; apply toObject() recursively for find and update queries #3086 [naoina](https://github.com/naoina)
3292
32934.1.1 / 2015-08-03
3294==================
3295 * fixed; aggregate exec() crash with no callback #3212 #3198 [jpgarcia](https://github.com/jpgarcia)
3296 * fixed; pre init hooks now properly synchronous #3207 [burtonjc](https://github.com/burtonjc)
3297 * fixed; updateValidators doesn't flatten dates #3206 #3194 [victorkohl](https://github.com/victorkohl)
3298 * fixed; default fields don't make document dirty between saves #3205 [burtonjc](https://github.com/burtonjc)
3299 * fixed; save passes 0 as numAffected rather than undefined when no change #3195 [burtonjc](https://github.com/burtonjc)
3300 * fixed; better handling for positional operator in update #3185
3301 * fixed; use Travis containers #3181 [ChristianMurphy](https://github.com/ChristianMurphy)
3302 * fixed; leaked variable #3180 [ChristianMurphy](https://github.com/ChristianMurphy)
3303
33044.1.0 / 2015-07-24
3305==================
3306 * added; `schema.queue()` now public #3193
3307 * added; raw result as third parameter to findOneAndX callback #3173
3308 * added; ability to run validateSync() on only certain fields #3153
3309 * added; subPopulate #3103 [timbur](https://github.com/timbur)
3310 * added; $isDefault function on documents #3077
3311 * added; additional properties for built-in validator messages #3063 [KLicheR](https://github.com/KLicheR)
3312 * added; getQuery() and getUpdate() functions for Query #3013
3313 * added; export DocumentProvider #2996
3314 * added; ability to remove path from schema #2993 [JohnnyEstilles](https://github.com/JohnnyEstilles)
3315 * added; .explain() helper for aggregate #2714
3316 * added; ability to specify which ES6-compatible promises library mongoose uses #2688
3317 * added; export Aggregate #1910
3318
33194.0.8 / 2015-07-20
3320==================
3321 * fixed; assignment with document arrays #3178 [rosston](https://github.com/rosston)
3322 * docs; remove duplicate paragraph #3164 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3323 * docs; improve findOneAndXYZ parameter descriptions #3159 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3324 * docs; add findOneAndRemove to list of supported middleware #3158
3325 * docs; clarify ensureIndex #3156
3326 * fixed; refuse to save/remove document without id #3118
3327 * fixed; hooks next() no longer accidentally returns promise #3104
3328 * fixed; strict mode for findOneAndUpdate #2947
3329 * added; .min.js.gz file for browser component #2806
3330
33313.8.34 / 2015-07-20
3332===================
3333 * fixed; allow using $rename #3171
3334 * fixed; no longer modifies update arguments #3008
3335
33364.0.7 / 2015-07-11
3337==================
3338 * fixed; documentarray id method when using object id #3157 [siboulet](https://github.com/siboulet)
3339 * docs; improve findById docs #3147
3340 * fixed; update validators handle null properly #3136 [odeke-em](https://github.com/odeke-em)
3341 * docs; jsdoc syntax errors #3128 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3342 * docs; fix typo #3126 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3343 * docs; proper formatting in queries.jade #3121 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3344 * docs; correct example for string maxlength validator #3111 [rhmeeuwisse](https://github.com/rhmeeuwisse)
3345 * fixed; setDefaultsOnInsert with arrays #3107
3346 * docs; LearnBoost -> Automattic in package.json #3099
3347 * docs; pre update hook example #3094 [danpe](https://github.com/danpe)
3348 * docs; clarify query middleware example #3051
3349 * fixed; ValidationErrors in strict mode #3046
3350 * fixed; set findOneAndUpdate properties before hooks run #3024
3351
33523.8.33 / 2015-07-10
3353===================
3354 * upgraded; node driver -> 1.4.38
3355 * fixed; dont crash when `match` validator undefined
3356
33574.0.6 / 2015-06-21
3358==================
3359 * upgraded; node driver -> 2.0.34 #3087
3360 * fixed; apply setters on addToSet, etc #3067 [victorkohl](https://github.com/victorkohl)
3361 * fixed; missing semicolons #3065 [sokolikp](https://github.com/sokolikp)
3362 * fixed; proper handling for async doc hooks #3062 [gregthegeek](https://github.com/gregthegeek)
3363 * fixed; dont set failed populate field to null if other docs are successfully populated #3055 [eloytoro](https://github.com/eloytoro)
3364 * fixed; setDefaultsOnInsert with document arrays #3034 [taxilian](https://github.com/taxilian)
3365 * fixed; setters fired on array items #3032
3366 * fixed; stop validateSync() on first error #3025 [victorkohl](https://github.com/victorkohl)
3367 * docs; improve query docs #3016
3368 * fixed; always exclude _id when its deselected #3010
3369 * fixed; enum validator kind property #3009
3370 * fixed; mquery collection names #3005
3371 * docs; clarify mongos option #3000
3372 * docs; clarify that query builder has a .then() #2995
3373 * fixed; race condition in dynamic ref #2992
3374
33753.8.31 / 2015-06-20
3376===================
3377 * fixed; properly handle text search with discriminators and $meta #2166
3378
33794.0.5 / 2015-06-05
3380==================
3381 * fixed; ObjectIds and buffers when mongodb driver is a sibling dependency #3050 #3048 #3040 #3031 #3020 #2988 #2951
3382 * fixed; warn user when 'increment' is used in schema #3039
3383 * fixed; setDefaultsOnInsert with array in schema #3035
3384 * fixed; dont use default Object toString to cast to string #3030
3385 * added; npm badge #3020 [odeke-em](https://github.com/odeke-em)
3386 * fixed; proper handling for calling .set() with a subdoc #2782
3387 * fixed; dont throw cast error when using $rename on non-string path #1845
3388
33893.8.30 / 2015-06-05
3390===================
3391 * fixed; enable users to set all options with tailable() #2883
3392
33934.0.4 / 2015-05-28
3394==================
3395 * docs; findAndModify new parameter correct default value #3012 [JonForest](https://github.com/JonForest)
3396 * docs; clarify pluralization rules #2999 [anonmily](https://github.com/anonmily)
3397 * fix; discriminators with schema methods #2978
3398 * fix; make `isModified` a schema reserved keyword #2975
3399 * fix; properly fire setters when initializing path with object #2943
3400 * fix; can use `setDefaultsOnInsert` without specifying `runValidators` #2938
3401 * fix; always set validation errors `kind` property #2885
3402 * upgraded; node driver -> 2.0.33 #2865
3403
34043.8.29 / 2015-05-27
3405===================
3406 * fixed; Handle JSON.stringify properly for nested docs #2990
3407
34084.0.3 / 2015-05-13
3409==================
3410 * upgraded; mquery -> 1.5.1 #2983
3411 * docs; clarify context for query middleware #2974
3412 * docs; fix missing type -> kind rename in History.md #2961
3413 * fixed; broken ReadPreference include on Heroku #2957
3414 * docs; correct form for cursor aggregate option #2955
3415 * fixed; sync post hooks now properly called after function #2949 #2925
3416 * fixed; fix sub-doc validate() function #2929
3417 * upgraded; node driver -> 2.0.30 #2926
3418 * docs; retainKeyOrder for save() #2924
3419 * docs; fix broken class names #2913
3420 * fixed; error when using node-clone on a doc #2909
3421 * fixed; no more hard references to bson #2908 #2906
3422 * fixed; dont overwrite array values #2907 [naoina](https://github.com/naoina)
3423 * fixed; use readPreference=primary for findOneAndUpdate #2899 #2823
3424 * docs; clarify that update validators only run on $set and $unset #2889
3425 * fixed; set kind consistently for built-in validators #2885
3426 * docs; single field populated documents #2884
3427 * fixed; nested objects are now enumerable #2880 [toblerpwn](https://github.com/toblerpwn)
3428 * fixed; properly populate field when ref, lean, stream used together #2841
3429 * docs; fixed migration guide jade error #2807
3430
34313.8.28 / 2015-05-12
3432===================
3433 * fixed; proper handling for toJSON options #2910
3434 * fixed; dont attach virtuals to embedded docs in update() #2046
3435
34364.0.2 / 2015-04-23
3437==================
3438 * fixed; error thrown when calling .validate() on subdoc not in an array #2902
3439 * fixed; rename define() to play nice with webpack #2900 [jspears](https://github.com/jspears)
3440 * fixed; pre validate called twice with discriminators #2892
3441 * fixed; .inspect() on mongoose.Types #2875
3442 * docs; correct callback params for Model.update #2872
3443 * fixed; setDefaultsOnInsert now works when runValidators not specified #2870
3444 * fixed; Document now wraps EventEmitter.addListener #2867
3445 * fixed; call non-hook functions in schema queue #2856
3446 * fixed; statics can be mocked out for tests #2848 [ninelb](https://github.com/ninelb)
3447 * upgraded; mquery 1.4.0 for bluebird bug fix #2846
3448 * fixed; required validators run first #2843
3449 * docs; improved docs for new option to findAndMody #2838
3450 * docs; populate example now uses correct field #2837 [swilliams](https://github.com/swilliams)
3451 * fixed; pre validate changes causing VersionError #2835
3452 * fixed; get path from correct place when setting CastError #2832
3453 * docs; improve docs for Model.update() function signature #2827 [irnc](https://github.com/irnc)
3454 * fixed; populating discriminators #2825 [chetverikov](https://github.com/chetverikov)
3455 * fixed; discriminators with nested schemas #2821
3456 * fixed; CastErrors with embedded docs #2819
3457 * fixed; post save hook context #2816
3458 * docs; 3.8.x -> 4.x migration guide #2807
3459 * fixed; proper _distinct copying for query #2765 [cdelauder](https://github.com/cdelauder)
3460
34613.8.27 / 2015-04-22
3462===================
3463 * fixed; dont duplicate db calls on Q.ninvoke() #2864
3464 * fixed; Model.find arguments naming in docs #2828
3465 * fixed; Support ipv6 in connection strings #2298
3466
34673.8.26 / 2015-04-07
3468===================
3469 * fixed; TypeError when setting date to undefined #2833
3470 * fixed; handle CastError properly in distinct() with no callback #2786
3471 * fixed; broken links in queries docs #2779
3472 * fixed; dont mark buffer as modified when setting type initially #2738
3473 * fixed; dont crash when using slice with populate #1934
3474
34754.0.1 / 2015-03-28
3476==================
3477 * fixed; properly handle empty cast doc in update() with promises #2796
3478 * fixed; unstable warning #2794
3479 * fixed; findAndModify docs now show new option is false by default #2793
3480
34814.0.0 / 2015-03-25
3482==================
3483 * fixed; on-the-fly schema docs typo #2783 [artiifix](https://github.com/artiifix)
3484 * fixed; cast error validation handling #2775 #2766 #2678
3485 * fixed; discriminators with populate() #2773 #2719 [chetverikov](https://github.com/chetverikov)
3486 * fixed; increment now a reserved path #2709
3487 * fixed; avoid sending duplicate object ids in populate() #2683
3488 * upgraded; mongodb to 2.0.24 to properly emit reconnect event multiple times #2656
3489
34904.0.0-rc4 / 2015-03-14
3491======================
3492 * fixed; toObject virtuals schema option handled properly #2751
3493 * fixed; update validators work on document arrays #2733
3494 * fixed; check for cast errors on $set #2729
3495 * fixed; instance field set for all schema types #2727 [csdco](https://github.com/csdco)
3496 * fixed; dont run other validators if required fails #2725
3497 * fixed; custom getters execute on ref paths #2610
3498 * fixed; save defaults if they were set when doc was loaded from db #2558
3499 * fixed; pre validate now runs before pre save #2462
3500 * fixed; no longer throws errors with --use_strict #2281
3501
35023.8.25 / 2015-03-13
3503===================
3504 * fixed; debug output reverses order of aggregation keys #2759
3505 * fixed; $eq is a valid query selector in 3.0 #2752
3506 * fixed; upgraded node driver to 1.4.32 for handling non-numeric poolSize #2682
3507 * fixed; update() with overwrite sets _id for nested docs #2658
3508 * fixed; casting for operators in $elemMatch #2199
3509
35104.0.0-rc3 / 2015-02-28
3511======================
3512 * fixed; update() pre hooks run before validators #2706
3513 * fixed; setters not called on arrays of refs #2698 [brandom](https://github.com/brandom)
3514 * fixed; use node driver 2.0.18 for nodejs 0.12 support #2685
3515 * fixed; comments reference file that no longer exists #2681
3516 * fixed; populated() returns _id of manually populated doc #2678
3517 * added; ability to exclude version key in toObject() #2675
3518 * fixed; dont allow setting nested path to a string #2592
3519 * fixed; can cast objects with _id field to ObjectIds #2581
3520 * fixed; on-the-fly schema getters #2360
3521 * added; strict option for findOneAndUpdate() #1967
3522
35233.8.24 / 2015-02-25
3524===================
3525 * fixed; properly apply child schema transforms #2691
3526 * fixed; make copy of findOneAndUpdate options before modifying #2687
3527 * fixed; apply defaults when parent path is selected #2670 #2629
3528 * fixed; properly get ref property for nested paths #2665
3529 * fixed; node driver makes copy of authenticate options before modifying them #2619
3530 * fixed; dont block process exit when auth fails #2599
3531 * fixed; remove redundant clone in update() #2537
3532
35334.0.0-rc2 / 2015-02-10
3534======================
3535 * added; io.js to travis build
3536 * removed; browser build dependencies not installed by default
3537 * added; dynamic refpaths #2640 [chetverikov](https://github.com/chetverikov)
3538 * fixed; dont call child schema transforms on parent #2639 [chetverikov](https://github.com/chetverikov)
3539 * fixed; get rid of remove option if new is set in findAndModify #2598
3540 * fixed; aggregate all document array validation errors #2589
3541 * fixed; custom setters called when setting value to undefined #1892
3542
35433.8.23 / 2015-02-06
3544===================
3545 * fixed; unset opts.remove when upsert is true #2519
3546 * fixed; array saved as object when path is object in array #2442
3547 * fixed; inline transforms #2440
3548 * fixed; check for callback in count() #2204
3549 * fixed; documentation for selecting fields #1534
3550
35514.0.0-rc1 / 2015-02-01
3552======================
3553 * fixed; use driver 2.0.14
3554 * changed; use transform: true by default #2245
3555
35564.0.0-rc0 / 2015-01-31
3557===================
3558 * fixed; wrong order for distinct() params #2628
3559 * fixed; handling no query argument to remove() #2627
3560 * fixed; createModel and discriminators #2623 [ashaffer](https://github.com/ashaffer)
3561 * added; pre('count') middleware #2621
3562 * fixed; double validation calls on document arrays #2618
3563 * added; validate() catches cast errors #2611
3564 * fixed; respect replicaSet parameter in connection string #2609
3565 * added; can explicitly exclude paths from versioning #2576 [csabapalfi](https://github.com/csabapalfi)
3566 * upgraded; driver to 2.0.15 #2552
3567 * fixed; save() handles errors more gracefully in ES6 #2371
3568 * fixed; undefined is now a valid argument to findOneAndUpdate #2272
3569 * changed; `new` option to findAndModify ops is false by default #2262
3570
35713.8.22 / 2015-01-24
3572===================
3573 * upgraded; node-mongodb-native to 1.4.28 #2587 [Climax777](https://github.com/Climax777)
3574 * added; additional documentation for validators #2449
3575 * fixed; stack overflow when creating massive arrays #2423
3576 * fixed; undefined is a valid id for queries #2411
3577 * fixed; properly create nested schema index when same schema used twice #2322
3578 * added; link to plugin generator in docs #2085 [huei90](https://github.com/huei90)
3579 * fixed; optional arguments documentation for findOne() #1971 [nachinius](https://github.com/nachinius)
3580
35813.9.7 / 2014-12-19
3582===================
3583 * added; proper cursors for aggregate #2539 [changyy](https://github.com/changyy)
3584 * added; min/max built-in validators for dates #2531 [bshamblen](https://github.com/bshamblen)
3585 * fixed; save and validate are now reserved keywords #2380
3586 * added; basic documentation for browser component #2256
3587 * added; find and findOne hooks (query middleware) #2138
3588 * fixed; throw a DivergentArrayError when saving positional operator queries #2031
3589 * added; ability to use options as a document property #1416
3590 * fixed; document no longer inherits from event emitter and so domain and _events are no longer reserved #1351
3591 * removed; setProfiling #1349
3592
35933.8.21 / 2014-12-18
3594===================
3595 * fixed; syntax in index.jade #2517 [elderbas](https://github.com/elderbas)
3596 * fixed; writable statics #2510 #2528
3597 * fixed; overwrite and explicit $set casting #2515
3598
35993.9.6 / 2014-12-05
3600===================
3601 * added; correctly run validators on each element of array when entire array is modified #661 #1227
3602 * added; castErrors in validation #1013 [jondavidjohn](https://github.com/jondavidjohn)
3603 * added; specify text indexes in schema fields #1401 [sr527](https://github.com/sr527)
3604 * added; ability to set field with validators to undefined #1594 [alabid](https://github.com/alabid)
3605 * added; .create() returns an array when passed an array #1746 [alabid](https://github.com/alabid)
3606 * added; test suite and docs for use with co and yield #2177 #2474
3607 * fixed; subdocument toObject() transforms #2447 [chmanie](https://github.com/chmanie)
3608 * fixed; Model.create() with save errors #2484
3609 * added; pass options to .save() and .remove() #2494 [jondavidjohn](https://github.com/jondavidjohn)
3610
36113.8.20 / 2014-12-01
3612===================
3613 * fixed; recursive readPref #2490 [kjvalencik](https://github.com/kjvalencik)
3614 * fixed; make sure to copy parameters to update() before modifying #2406 [alabid](https://github.com/alabid)
3615 * fixed; unclear documentation about query callbacks #2319
3616 * fixed; setting a schema-less field to an empty object #2314 [alabid](https://github.com/alabid)
3617 * fixed; registering statics and methods for discriminators #2167 [alabid](https://github.com/alabid)
3618
36193.9.5 / 2014-11-10
3620===================
3621 * added; ability to disable autoIndex on a per-connection basis #1875 [sr527](https://github.com/sr527)
3622 * fixed; `geoNear()` no longer enforces legacy coordinate pairs - supports GeoJSON #1987 [alabid](https://github.com/alabid)
3623 * fixed; browser component works when minified with mangled variable names #2302
3624 * fixed; `doc.errors` now cleared before `validate()` called #2302
3625 * added; `execPopulate()` function to make `doc.populate()` compatible with promises #2317
3626 * fixed; `count()` no longer throws an error when used with `sort()` #2374
3627 * fixed; `save()` no longer recursively calls `save()` on populated fields #2418
3628
36293.8.19 / 2014-11-09
3630===================
3631 * fixed; make sure to not override subdoc _ids on find #2276 [alabid](https://github.com/alabid)
3632 * fixed; exception when comparing two documents when one lacks _id #2333 [slawo](https://github.com/slawo)
3633 * fixed; getters for properties with non-strict schemas #2439 [alabid](https://github.com/alabid)
3634 * fixed; inconsistent URI format in docs #2414 [sr527](https://github.com/sr527)
3635
36363.9.4 / 2014-10-25
3637==================
3638 * fixed; statics no longer can be overwritten #2343 [nkcmr](https://github.com/chetverikov)
3639 * added; ability to set single populated paths to documents #1530
3640 * added; setDefaultsOnInsert and runValidator options for findOneAndUpdate() #860
3641
36423.8.18 / 2014-10-22
3643==================
3644 * fixed; Dont use all toObject options in save #2340 [chetverikov](https://github.com/chetverikov)
3645
36463.9.3 / 2014-10-01
3647=================
3648 * added; support for virtuals that return objects #2294
3649 * added; ability to manually hydrate POJOs into mongoose objects #2292
3650 * added; setDefaultsOnInsert and runValidator options for update() #860
3651
36523.8.17 / 2014-09-29
3653==================
3654 * fixed; use schema options retainKeyOrder in save() #2274
3655 * fixed; fix skip in populate when limit is set #2252
3656 * fixed; fix stack overflow when passing MongooseArray to findAndModify #2214
3657 * fixed; optimize .length usage in populate #2289
3658
36593.9.2 / 2014-09-08
3660==================
3661 * added; test coverage for browser component #2255
3662 * added; in-order execution of validators #2243
3663 * added; custom fields for validators #2132
3664 * removed; exception thrown when find() used with count() #1950
3665
36663.8.16 / 2014-09-08
3667==================
3668 * fixed; properly remove modified array paths if array has been overwritten #1638
3669 * fixed; key check errors #1884
3670 * fixed; make sure populate on an array always returns a Mongoose array #2214
3671 * fixed; SSL connections with node 0.11 #2234
3672 * fixed; return sensible strings for promise errors #2239
3673
36743.9.1 / 2014-08-17
3675==================
3676 * added; alpha version of browser-side schema validation #2254
3677 * added; support passing a function to schemas `required` field #2247
3678 * added; support for setting updatedAt and createdAt timestamps #2227
3679 * added; document.validate() returns a promise #2131
3680
36813.8.15 / 2014-08-17
3682==================
3683 * fixed; Replica set connection string example in docs #2246
3684 * fixed; bubble up parseError event #2229
3685 * fixed; removed buggy populate cache #2176
3686 * fixed; dont $inc versionKey if its being $set #1933
3687 * fixed; cast $or and $and in $pull #1932
3688 * fixed; properly cast to schema in stream() #1862
3689 * fixed; memory leak in nested objects #1565 #2211 [devongovett](https://github.com/devongovett)
3690
36913.8.14 / 2014-07-26
3692==================
3693 * fixed; stringifying MongooseArray shows nested arrays #2002
3694 * fixed; use populated doc schema in toObject and toJSON by default #2035
3695 * fixed; dont crash on arrays containing null #2140
3696 * fixed; model.update w/ upsert has same return values on .exec and promise #2143
3697 * fixed; better handling for populate limit with multiple documents #2151
3698 * fixed; dont prevent users from adding weights to text index #2183
3699 * fixed; helper for aggregation cursor #2187
3700 * updated; node-mongodb-native to 1.4.7
3701
37023.8.13 / 2014-07-15
3703==================
3704 * fixed; memory leak with isNew events #2159
3705 * fixed; docs for overwrite option for update() #2144
3706 * fixed; storeShard() handles dates properly #2127
3707 * fixed; sub-doc changes not getting persisted to db after save #2082
3708 * fixed; populate with _id: 0 actually removes _id instead of setting to undefined #2123
3709 * fixed; save versionKey on findOneAndUpdate w/ upsert #2122
3710 * fixed; fix typo in 2.8 docs #2120 [shakirullahi](https://github.com/shakirullahi)
3711 * fixed; support maxTimeMs #2102 [yuukinajima](https://github.com/yuukinajima)
3712 * fixed; support $currentDate #2019
3713 * fixed; $addToSet handles objects without _ids properly #1973
3714 * fixed; dont crash on invalid nearSphere query #1874
3715
37163.8.12 / 2014-05-30
3717==================
3718 * fixed; single-server reconnect event fires #1672
3719 * fixed; sub-docs not saved when pushed into populated array #1794
3720 * fixed; .set() sometimes converts embedded docs to pojos #1954 [archangel-irk](https://github.com/archangel-irk)
3721 * fixed; sub-doc changes not getting persisted to db after save #2082
3722 * fixed; custom getter might cause mongoose to mistakenly think a path is dirty #2100 [pgherveou](https://github.com/pgherveou)
3723 * fixed; chainable helper for allowDiskUse option in aggregation #2114
3724
37253.9.0 (unstable) / 2014-05-22
3726==================
3727 * changed; added `domain` to reserved keywords #1338 #2052 [antoinepairet](https://github.com/antoinepairet)
3728 * added; asynchronous post hooks #1977 #2081 [chopachom](https://github.com/chopachom) [JasonGhent](https://github.com/JasonGhent)
3729 * added; using model for population, cross-db populate [mihai-chiorean](https://github.com/mihai-chiorean)
3730 * added; can define a type for schema validators
3731 * added; `doc.remove()` returns a promise #1619 [refack](https://github.com/refack)
3732 * added; internal promises for hooks, pre-save hooks run in parallel #1732 [refack](https://github.com/refack)
3733 * fixed; geoSearch hanging when no results returned #1846 [ghartnett](https://github.com/ghartnett)
3734 * fixed; do not set .type property on ValidationError, use .kind instead #1323
3735
37363.8.11 / 2014-05-22
3737==================
3738 * updated; node-mongodb-native to 1.4.5
3739 * reverted; #2052, fixes #2097
3740
37413.8.10 / 2014-05-20
3742==================
3743
3744 * updated; node-mongodb-native to 1.4.4
3745 * fixed; _.isEqual false negatives bug in js-bson #2070
3746 * fixed; missing check for schema.options #2014
3747 * fixed; missing support for $position #2024
3748 * fixed; options object corruption #2049
3749 * fixed; improvements to virtuals docs #2055
3750 * fixed; added `domain` to reserved keywords #2052 #1338
3751
37523.8.9 / 2014-05-08
3753==================
3754
3755 * updated; mquery to 0.7.0
3756 * updated; node-mongodb-native to 1.4.3
3757 * fixed; $near failing against MongoDB 2.6
3758 * fixed; relying on .options() to determine if collection exists
3759 * fixed; $out aggregate helper
3760 * fixed; all test failures against MongoDB 2.6.1, with caveat #2065
3761
37623.8.8 / 2014-02-22
3763==================
3764
3765 * fixed; saving Buffers #1914
3766 * updated; expose connection states for user-land #1926 [yorkie](https://github.com/yorkie)
3767 * updated; mquery to 0.5.3
3768 * updated; added get / set to reserved path list #1903 [tstrimple](https://github.com/tstrimple)
3769 * docs; README code highlighting, syntax fixes #1930 [IonicaBizau](https://github.com/IonicaBizau)
3770 * docs; fixes link in the doc at #1925 [kapeels](https://github.com/kapeels)
3771 * docs; add a missed word 'hook' for the description of the post-hook api #1924 [ipoval](https://github.com/ipoval)
3772
37733.8.7 / 2014-02-09
3774==================
3775
3776 * fixed; sending safe/read options in Query#exec #1895
3777 * fixed; findOneAnd..() with sort #1887
3778
37793.8.6 / 2014-01-30
3780==================
3781
3782 * fixed; setting readPreferences #1895
3783
37843.8.5 / 2014-01-23
3785==================
3786
3787 * fixed; ssl setting when using URI #1882
3788 * fixed; findByIdAndUpdate now respects the overwrite option #1809 [owenallenaz](https://github.com/owenallenaz)
3789
37903.8.4 / 2014-01-07
3791==================
3792
3793 * updated; mongodb driver to 1.3.23
3794 * updated; mquery to 0.4.1
3795 * updated; mpromise to 0.4.3
3796 * fixed; discriminators now work when selecting fields #1820 [daemon1981](https://github.com/daemon1981)
3797 * fixed; geoSearch with no results timeout #1846 [ghartnett](https://github.com/ghartnett)
3798 * fixed; infitite recursion in ValidationError #1834 [chetverikov](https://github.com/chetverikov)
3799
38003.8.3 / 2013-12-17
3801==================
3802
3803 * fixed; setting empty array with model.update #1838
3804 * docs; fix url
3805
38063.8.2 / 2013-12-14
3807==================
3808
3809 * fixed; enum validation of multiple values #1778 [heroicyang](https://github.com/heroicyang)
3810 * fixed; global var leak #1803
3811 * fixed; post remove now fires on subdocs #1810
3812 * fixed; no longer set default empty array for geospatial-indexed fields #1668 [shirish87](https://github.com/shirish87)
3813 * fixed; model.stream() not hydrating discriminators correctly #1792 [j](https://github.com/j)
3814 * docs: Stablility -> Stability [nikmartin](https://github.com/nikmartin)
3815 * tests; improve shard error handling
3816
38173.8.1 / 2013-11-19
3818==================
3819
3820 * fixed; mishandling of Dates with minimize/getters #1764
3821 * fixed; Normalize bugs.email, so `npm` will shut up #1769 [refack](https://github.com/refack)
3822 * docs; Improve the grammar where "lets us" was used #1777 [alexyoung](https://github.com/alexyoung)
3823 * docs; Fix some grammatical issues in the documentation #1777 [alexyoung](https://github.com/alexyoung)
3824 * docs; fix Query api exposure
3825 * docs; fix return description
3826 * docs; Added Notes on findAndUpdate() #1750 [sstadelman](https://github.com/sstadelman)
3827 * docs; Update version number in README #1762 [Fodi69](https://github.com/Fodi69)
3828
38293.8.0 / 2013-10-31
3830==================
3831
3832 * updated; warn when using an unstable version
3833 * updated; error message returned in doc.save() #1595
3834 * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
3835 * updated; mquery to 0.3.2
3836 * updated; mocha to 1.12.0
3837 * updated; mpromise 0.3.0
3838 * updated; sliced 0.0.5
3839 * removed; mongoose.Error.DocumentError (never used)
3840 * removed; namedscope (undocumented and broken) #679 #642 #455 #379
3841 * changed; no longer offically supporting node 0.6.x
3842 * changed; query.within getter is now a method -> query.within()
3843 * changed; query.intersects getter is now a method -> query.intersects()
3844 * added; custom error msgs for built-in validators #747
3845 * added; discriminator support #1647 #1003 [j](https://github.com/j)
3846 * added; support disabled collection name pluralization #1350 #1707 [refack](https://github.com/refack)
3847 * added; support for GeoJSON to Query#near [ebensing](https://github.com/ebensing)
3848 * added; stand-alone base query support - query.toConstructor() [ebensing](https://github.com/ebensing)
3849 * added; promise support to geoSearch #1614 [ebensing](https://github.com/ebensing)
3850 * added; promise support for geoNear #1614 [ebensing](https://github.com/ebensing)
3851 * added; connection.useDb() #1124 [ebensing](https://github.com/ebensing)
3852 * added; promise support to model.mapReduce()
3853 * added; promise support to model.ensureIndexes()
3854 * added; promise support to model.populate()
3855 * added; benchmarks [ebensing](https://github.com/ebensing)
3856 * added; publicly exposed connection states #1585
3857 * added; $geoWithin support #1529 $1455 [ebensing](https://github.com/ebensing)
3858 * added; query method chain validation
3859 * added; model.update `overwrite` option
3860 * added; model.geoNear() support #1563 [ebensing](https://github.com/ebensing)
3861 * added; model.geoSearch() support #1560 [ebensing](https://github.com/ebensing)
3862 * added; MongooseBuffer#subtype()
3863 * added; model.create() now returns a promise #1340
3864 * added; support for `awaitdata` query option
3865 * added; pass the doc to doc.remove() callback #1419 [JoeWagner](https://github.com/JoeWagner)
3866 * added; aggregation query builder #1404 [njoyard](https://github.com/njoyard)
3867 * fixed; document.toObject when using `minimize` and `getters` options #1607 [JedWatson](https://github.com/JedWatson)
3868 * fixed; Mixed types can now be required #1722 [Reggino](https://github.com/Reggino)
3869 * fixed; do not pluralize model names not ending with letters #1703 [refack](https://github.com/refack)
3870 * fixed; repopulating modified populated paths #1697
3871 * fixed; doc.equals() when _id option is set to false #1687
3872 * fixed; strict mode warnings #1686
3873 * fixed; $near GeoJSON casting #1683
3874 * fixed; nearSphere GeoJSON query builder
3875 * fixed; population field selection w/ strings #1669
3876 * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
3877 * fixed; handle another versioning edge case #1520
3878 * fixed; excluding subdocument fields #1280 [ebensing](https://github.com/ebensing)
3879 * fixed; allow array properties to be set to null with findOneAndUpdate [aheuermann](https://github.com/aheuermann)
3880 * fixed; subdocuments now use own toJSON opts #1376 [ebensing](https://github.com/ebensing)
3881 * fixed; model#geoNear fulfills promise when results empty #1658 [ebensing](https://github.com/ebensing)
3882 * fixed; utils.merge no longer overrides props and methods #1655 [j](https://github.com/j)
3883 * fixed; subdocuments now use their own transform #1412 [ebensing](https://github.com/ebensing)
3884 * fixed; model.remove() removes only what is necessary #1649
3885 * fixed; update() now only runs with cb or explicit true #1644
3886 * fixed; casting ref docs on creation #1606 [ebensing](https://github.com/ebensing)
3887 * fixed; model.update "overwrite" option works as documented
3888 * fixed; query#remove() works as documented
3889 * fixed; "limit" correctly applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
3890 * fixed; issue with positional operator on ref docs #1572 [ebensing](https://github.com/ebensing)
3891 * fixed; benchmarks to actually output valid json
3892 * deprecated; promise#addBack (use promise#onResolve)
3893 * deprecated; promise#complete (use promise#fulfill)
3894 * deprecated; promise#addCallback (use promise#onFulFill)
3895 * deprecated; promise#addErrback (use promise#onReject)
3896 * deprecated; query.nearSphere() (use query.near)
3897 * deprecated; query.center() (use query.circle)
3898 * deprecated; query.centerSphere() (use query.circle)
3899 * deprecated; query#slaveOk (use query#read)
3900 * docs; custom validator messages
3901 * docs; 10gen -> MongoDB
3902 * docs; add Date method caveats #1598
3903 * docs; more validation details
3904 * docs; state which branch is stable/unstable
3905 * docs; mention that middleware does not run on Models
3906 * docs; promise.fulfill()
3907 * docs; fix readme spelling #1483 [yorchopolis](https://github.com/yorchopolis)
3908 * docs; fixed up the README and examples [ebensing](https://github.com/ebensing)
3909 * website; add "show code" for properties
3910 * website; move "show code" links down
3911 * website; update guide
3912 * website; add unstable docs
3913 * website; many improvements
3914 * website; fix copyright #1439
3915 * website; server.js -> static.js #1546 [nikmartin](https://github.com/nikmartin)
3916 * tests; refactor 1703
3917 * tests; add test generator
3918 * tests; validate formatMessage() throws
3919 * tests; add script for continuously running tests
3920 * tests; fixed versioning tests
3921 * tests; race conditions in tests
3922 * tests; added for nested and/or queries
3923 * tests; close some test connections
3924 * tests; validate db contents
3925 * tests; remove .only
3926 * tests; close some test connections
3927 * tests; validate db contents
3928 * tests; remove .only
3929 * tests; replace deprecated method names
3930 * tests; convert id to string
3931 * tests; fix sharding tests for MongoDB 2.4.5
3932 * tests; now 4-5 seconds faster
3933 * tests; fix race condition
3934 * make; suppress warning msg in test
3935 * benchmarks; updated for pull requests
3936 * examples; improved and expanded [ebensing](https://github.com/ebensing)
3937
39383.7.4 (unstable) / 2013-10-01
3939=============================
3940
3941 * updated; mquery to 0.3.2
3942 * removed; mongoose.Error.DocumentError (never used)
3943 * added; custom error msgs for built-in validators #747
3944 * added; discriminator support #1647 #1003 [j](https://github.com/j)
3945 * added; support disabled collection name pluralization #1350 #1707 [refack](https://github.com/refack)
3946 * fixed; do not pluralize model names not ending with letters #1703 [refack](https://github.com/refack)
3947 * fixed; repopulating modified populated paths #1697
3948 * fixed; doc.equals() when _id option is set to false #1687
3949 * fixed; strict mode warnings #1686
3950 * fixed; $near GeoJSON casting #1683
3951 * fixed; nearSphere GeoJSON query builder
3952 * fixed; population field selection w/ strings #1669
3953 * docs; custom validator messages
3954 * docs; 10gen -> MongoDB
3955 * docs; add Date method caveats #1598
3956 * docs; more validation details
3957 * website; add "show code" for properties
3958 * website; move "show code" links down
3959 * tests; refactor 1703
3960 * tests; add test generator
3961 * tests; validate formatMessage() throws
3962
39633.7.3 (unstable) / 2013-08-22
3964=============================
3965
3966 * updated; warn when using an unstable version
3967 * updated; mquery to 0.3.1
3968 * updated; mocha to 1.12.0
3969 * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
3970 * changed; no longer offically supporting node 0.6.x
3971 * added; support for GeoJSON to Query#near [ebensing](https://github.com/ebensing)
3972 * added; stand-alone base query support - query.toConstructor() [ebensing](https://github.com/ebensing)
3973 * added; promise support to geoSearch #1614 [ebensing](https://github.com/ebensing)
3974 * added; promise support for geoNear #1614 [ebensing](https://github.com/ebensing)
3975 * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
3976 * fixed; handle another versioning edge case #1520
3977 * fixed; excluding subdocument fields #1280 [ebensing](https://github.com/ebensing)
3978 * fixed; allow array properties to be set to null with findOneAndUpdate [aheuermann](https://github.com/aheuermann)
3979 * fixed; subdocuments now use own toJSON opts #1376 [ebensing](https://github.com/ebensing)
3980 * fixed; model#geoNear fulfills promise when results empty #1658 [ebensing](https://github.com/ebensing)
3981 * fixed; utils.merge no longer overrides props and methods #1655 [j](https://github.com/j)
3982 * fixed; subdocuments now use their own transform #1412 [ebensing](https://github.com/ebensing)
3983 * make; suppress warning msg in test
3984 * docs; state which branch is stable/unstable
3985 * docs; mention that middleware does not run on Models
3986 * tests; add script for continuously running tests
3987 * tests; fixed versioning tests
3988 * benchmarks; updated for pull requests
3989
39903.7.2 (unstable) / 2013-08-15
3991==================
3992
3993 * fixed; model.remove() removes only what is necessary #1649
3994 * fixed; update() now only runs with cb or explicit true #1644
3995 * tests; race conditions in tests
3996 * website; update guide
3997
39983.7.1 (unstable) / 2013-08-13
3999=============================
4000
4001 * updated; driver to 1.3.18 (fixes memory leak)
4002 * added; connection.useDb() #1124 [ebensing](https://github.com/ebensing)
4003 * added; promise support to model.mapReduce()
4004 * added; promise support to model.ensureIndexes()
4005 * added; promise support to model.populate()
4006 * fixed; casting ref docs on creation #1606 [ebensing](https://github.com/ebensing)
4007 * fixed; model.update "overwrite" option works as documented
4008 * fixed; query#remove() works as documented
4009 * fixed; "limit" correctly applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
4010 * fixed; issue with positional operator on ref docs #1572 [ebensing](https://github.com/ebensing)
4011 * fixed; benchmarks to actually output valid json
4012 * tests; added for nested and/or queries
4013 * tests; close some test connections
4014 * tests; validate db contents
4015 * tests; remove .only
4016 * tests; close some test connections
4017 * tests; validate db contents
4018 * tests; remove .only
4019 * tests; replace deprecated method names
4020 * tests; convert id to string
4021 * docs; promise.fulfill()
4022
40233.7.0 (unstable) / 2013-08-05
4024===================
4025
4026 * changed; query.within getter is now a method -> query.within()
4027 * changed; query.intersects getter is now a method -> query.intersects()
4028 * deprecated; promise#addBack (use promise#onResolve)
4029 * deprecated; promise#complete (use promise#fulfill)
4030 * deprecated; promise#addCallback (use promise#onFulFill)
4031 * deprecated; promise#addErrback (use promise#onReject)
4032 * deprecated; query.nearSphere() (use query.near)
4033 * deprecated; query.center() (use query.circle)
4034 * deprecated; query.centerSphere() (use query.circle)
4035 * deprecated; query#slaveOk (use query#read)
4036 * removed; namedscope (undocumented and broken) #679 #642 #455 #379
4037 * added; benchmarks [ebensing](https://github.com/ebensing)
4038 * added; publicly exposed connection states #1585
4039 * added; $geoWithin support #1529 $1455 [ebensing](https://github.com/ebensing)
4040 * added; query method chain validation
4041 * added; model.update `overwrite` option
4042 * added; model.geoNear() support #1563 [ebensing](https://github.com/ebensing)
4043 * added; model.geoSearch() support #1560 [ebensing](https://github.com/ebensing)
4044 * added; MongooseBuffer#subtype()
4045 * added; model.create() now returns a promise #1340
4046 * added; support for `awaitdata` query option
4047 * added; pass the doc to doc.remove() callback #1419 [JoeWagner](https://github.com/JoeWagner)
4048 * added; aggregation query builder #1404 [njoyard](https://github.com/njoyard)
4049 * updated; integrate mquery #1562 [ebensing](https://github.com/ebensing)
4050 * updated; error msg in doc.save() #1595
4051 * updated; bump driver to 1.3.15
4052 * updated; mpromise 0.3.0
4053 * updated; sliced 0.0.5
4054 * tests; fix sharding tests for MongoDB 2.4.5
4055 * tests; now 4-5 seconds faster
4056 * tests; fix race condition
4057 * docs; fix readme spelling #1483 [yorchopolis](https://github.com/yorchopolis)
4058 * docs; fixed up the README and examples [ebensing](https://github.com/ebensing)
4059 * website; add unstable docs
4060 * website; many improvements
4061 * website; fix copyright #1439
4062 * website; server.js -> static.js #1546 [nikmartin](https://github.com/nikmartin)
4063 * examples; improved and expanded [ebensing](https://github.com/ebensing)
4064
40653.6.20 (stable) / 2013-09-23
4066===================
4067
4068 * fixed; repopulating modified populated paths #1697
4069 * fixed; doc.equals w/ _id false #1687
4070 * fixed; strict mode warning #1686
4071 * docs; near/nearSphere
4072
40733.6.19 (stable) / 2013-09-04
4074==================
4075
4076 * fixed; population field selection w/ strings #1669
4077 * docs; Date method caveats #1598
4078
40793.6.18 (stable) / 2013-08-22
4080===================
4081
4082 * updated; warn when using an unstable version of mongoose
4083 * updated; mocha to 1.12.0
4084 * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
4085 * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
4086 * fixed; properly exclude subdocument fields #1280 [ebensing](https://github.com/ebensing)
4087 * fixed; cast error in findAndModify #1643 [aheuermann](https://github.com/aheuermann)
4088 * website; update guide
4089 * website; added documentation for safe:false and versioning interaction
4090 * docs; mention that middleware dont run on Models
4091 * docs; fix indexes link
4092 * make; suppress warning msg in test
4093 * tests; moar
4094
40953.6.17 / 2013-08-13
4096===================
4097
4098 * updated; driver to 1.3.18 (fixes memory leak)
4099 * fixed; casting ref docs on creation #1606
4100 * docs; query options
4101
41023.6.16 / 2013-08-08
4103===================
4104
4105 * added; publicly expose connection states #1585
4106 * fixed; limit applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
4107 * fixed; positional operator casting in updates #1572 [ebensing](https://github.com/ebensing)
4108 * updated; MongoDB driver to 1.3.17
4109 * updated; sliced to 0.0.5
4110 * website; tweak homepage
4111 * tests; fixed + added
4112 * docs; fix some examples
4113 * docs; multi-mongos support details
4114 * docs; auto open browser after starting static server
4115
41163.6.15 / 2013-07-16
4117==================
4118
4119 * added; mongos failover support #1037
4120 * updated; make schematype return vals return self #1580
4121 * docs; add note to model.update #571
4122 * docs; document third param to document.save callback #1536
4123 * tests; tweek mongos test timeout
4124
41253.6.14 / 2013-07-05
4126===================
4127
4128 * updated; driver to 1.3.11
4129 * fixed; issue with findOneAndUpdate not returning null on upserts #1533 [ebensing](https://github.com/ebensing)
4130 * fixed; missing return statement in SchemaArray#$geoIntersects() #1498 [bsrykt](https://github.com/bsrykt)
4131 * fixed; wrong isSelected() behavior #1521 [kyano](https://github.com/kyano)
4132 * docs; note about toObject behavior during save()
4133 * docs; add callbacks details #1547 [nikmartin](https://github.com/nikmartin)
4134
41353.6.13 / 2013-06-27
4136===================
4137
4138 * fixed; calling model.distinct without conditions #1541
4139 * fixed; regression in Query#count() #1542
4140 * now working on 3.6.13
4141
41423.6.12 / 2013-06-25
4143===================
4144
4145 * updated; driver to 1.3.10
4146 * updated; clearer capped collection error message #1509 [bitmage](https://github.com/bitmage)
4147 * fixed; MongooseBuffer subtype loss during casting #1517 [zedgu](https://github.com/zedgu)
4148 * fixed; docArray#id when doc.id is disabled #1492
4149 * fixed; docArray#id now supports matches on populated arrays #1492 [pgherveou](https://github.com/pgherveou)
4150 * website; fix example
4151 * website; improve _id disabling example
4152 * website; fix typo #1494 [dejj](https://github.com/dejj)
4153 * docs; added a 'Requesting new features' section #1504 [shovon](https://github.com/shovon)
4154 * docs; improve subtypes description
4155 * docs; clarify _id disabling
4156 * docs: display by alphabetical order the methods list #1508 [nicolasleger](https://github.com/nicolasleger)
4157 * tests; refactor isSelected checks
4158 * tests; remove pointless test
4159 * tests; fixed timeouts
4160
41613.6.11 / 2013-05-15
4162===================
4163
4164 * updated; driver to 1.3.5
4165 * fixed; compat w/ Object.create(null) #1484 #1485
4166 * fixed; cloning objects w/ missing constructors
4167 * fixed; prevent multiple min number validators #1481 [nrako](https://github.com/nrako)
4168 * docs; add doc.increment() example
4169 * docs; add $size example
4170 * docs; add "distinct" example
4171
41723.6.10 / 2013-05-09
4173==================
4174
4175 * update driver to 1.3.3
4176 * fixed; increment() works without other changes #1475
4177 * website; fix links to posterous
4178 * docs; fix link #1472
4179
41803.6.9 / 2013-05-02
4181==================
4182
4183 * fixed; depopulation of mixed documents #1471
4184 * fixed; use of $options in array #1462
4185 * tests; fix race condition
4186 * docs; fix default example
4187
41883.6.8 / 2013-04-25
4189==================
4190
4191 * updated; driver to 1.3.0
4192 * fixed; connection.model should retain options #1458 [vedmalex](https://github.com/vedmalex)
4193 * tests; 4-5 seconds faster
4194
41953.6.7 / 2013-04-19
4196==================
4197
4198 * fixed; population regression in 3.6.6 #1444
4199
42003.6.6 / 2013-04-18
4201==================
4202
4203 * fixed; saving populated new documents #1442
4204 * fixed; population regession in 3.6.5 #1441
4205 * website; fix copyright #1439
4206
42073.6.5 / 2013-04-15
4208==================
4209
4210 * fixed; strict:throw edge case using .set(path, val)
4211 * fixed; schema.pathType() on some numbericAlpha paths
4212 * fixed; numbericAlpha path versioning
4213 * fixed; setting nested mixed paths #1418
4214 * fixed; setting nested objects with null prop #1326
4215 * fixed; regression in v3.6 population performance #1426 [vedmalex](https://github.com/vedmalex)
4216 * fixed; read pref typos #1422 [kyano](https://github.com/kyano)
4217 * docs; fix method example
4218 * website; update faq
4219 * website; add more deep links
4220 * website; update poolSize docs
4221 * website; add 3.6 release notes
4222 * website; note about keepAlive
4223
42243.6.4 / 2013-04-03
4225==================
4226
4227 * fixed; +field conflict with $slice #1370
4228 * fixed; nested deselection conflict #1333
4229 * fixed; RangeError in ValidationError.toString() #1296
4230 * fixed; do not save user defined transforms #1415
4231 * tests; fix race condition
4232
42333.6.3 / 2013-04-02
4234==================
4235
4236 * fixed; setting subdocuments deeply nested fields #1394
4237 * fixed; regression: populated streams #1411
4238 * docs; mention hooks/validation with findAndModify
4239 * docs; mention auth
4240 * docs; add more links
4241 * examples; add document methods example
4242 * website; display "see" links for properties
4243 * website; clean up homepage
4244
42453.6.2 / 2013-03-29
4246==================
4247
4248 * fixed; corrupted sub-doc array #1408
4249 * fixed; document#update returns a Query #1397
4250 * docs; readpref strategy
4251
42523.6.1 / 2013-03-27
4253==================
4254
4255 * added; populate support to findAndModify varients #1395
4256 * added; text index type to schematypes
4257 * expose allowed index types as Schema.indexTypes
4258 * fixed; use of `setMaxListeners` as path
4259 * fixed; regression in node 0.6 on docs with > 10 arrays
4260 * fixed; do not alter schema arguments #1364
4261 * fixed; subdoc#ownerDocument() #1385
4262 * website; change search id
4263 * website; add search from google [jackdbernier](https://github.com/jackdbernier)
4264 * website; fix link
4265 * website; add 3.5.x docs release
4266 * website; fix link
4267 * docs; fix geometry
4268 * docs; hide internal constructor
4269 * docs; aggregation does not cast arguments #1399
4270 * docs; querystream options
4271 * examples; added for population
4272
42733.6.0 / 2013-03-18
4274==================
4275
4276 * changed; cast 'true'/'false' to boolean #1282 [mgrach](https://github.com/mgrach)
4277 * changed; Buffer arrays can now contain nulls
4278 * added; QueryStream transform option
4279 * added; support for authSource driver option
4280 * added; {mongoose,db}.modelNames()
4281 * added; $push w/ $slice,$sort support (MongoDB 2.4)
4282 * added; hashed index type (MongoDB 2.4)
4283 * added; support for mongodb 2.4 geojson (MongoDB 2.4)
4284 * added; value at time of validation error
4285 * added; support for object literal schemas
4286 * added; bufferCommands schema option
4287 * added; allow auth option in connections #1360 [geoah](https://github.com/geoah)
4288 * added; performance improvements to populate() [263ece9](https://github.com/LearnBoost/mongoose/commit/263ece9)
4289 * added; allow adding uncasted docs to populated arrays and properties #570
4290 * added; doc#populated(path) stores original populated _ids
4291 * added; lean population #1260
4292 * added; query.populate() now accepts an options object
4293 * added; document#populate(opts, callback)
4294 * added; Model.populate(docs, opts, callback)
4295 * added; support for rich nested path population
4296 * added; doc.array.remove(value) subdoc with _id value support #1278
4297 * added; optionally allow non-strict sets and updates
4298 * added; promises/A+ comformancy with [mpromise](https://github.com/aheckmann/mpromise)
4299 * added; promise#then
4300 * added; promise#end
4301 * fixed; use of `model` as doc property
4302 * fixed; lean population #1382
4303 * fixed; empty object mixed defaults #1380
4304 * fixed; populate w/ deselected _id using string syntax
4305 * fixed; attempted save of divergent populated arrays #1334 related
4306 * fixed; better error msg when attempting toObject as property name
4307 * fixed; non population buffer casting from doc
4308 * fixed; setting populated paths #570
4309 * fixed; casting when added docs to populated arrays #570
4310 * fixed; prohibit updating arrays selected with $elemMatch #1334
4311 * fixed; pull / set subdoc combination #1303
4312 * fixed; multiple bg index creation #1365
4313 * fixed; manual reconnection to single mongod
4314 * fixed; Constructor / version exposure #1124
4315 * fixed; CastError race condition
4316 * fixed; no longer swallowing misuse of subdoc#invalidate()
4317 * fixed; utils.clone retains RegExp opts
4318 * fixed; population of non-schema property
4319 * fixed; allow updating versionKey #1265
4320 * fixed; add EventEmitter props to reserved paths #1338
4321 * fixed; can now deselect populated doc _ids #1331
4322 * fixed; properly pass subtype to Binary in MongooseBuffer
4323 * fixed; casting _id from document with non-ObjectId _id
4324 * fixed; specifying schema type edge case { path: [{type: "String" }] }
4325 * fixed; typo in schemdate #1329 [jplock](https://github.com/jplock)
4326 * updated; driver to 1.2.14
4327 * updated; muri to 0.3.1
4328 * updated; mpromise to 0.2.1
4329 * updated; mocha 1.8.1
4330 * updated; mpath to 0.1.1
4331 * deprecated; pluralization will die in 4.x
4332 * refactor; rename private methods to something unusable as doc properties
4333 * refactor MongooseArray#remove
4334 * refactor; move expires index to SchemaDate #1328
4335 * refactor; internal document properties #1171 #1184
4336 * tests; added
4337 * docs; indexes
4338 * docs; validation
4339 * docs; populate
4340 * docs; populate
4341 * docs; add note about stream compatibility with node 0.8
4342 * docs; fix for private names
4343 * docs; Buffer -> mongodb.Binary #1363
4344 * docs; auth options
4345 * docs; improved
4346 * website; update FAQ
4347 * website; add more api links
4348 * website; add 3.5.x docs to prior releases
4349 * website; Change mongoose-types to an active repo [jackdbernier](https://github.com/jackdbernier)
4350 * website; compat with node 0.10
4351 * website; add news section
4352 * website; use T for generic type
4353 * benchmark; make adjustable
4354
43553.6.0rc1 / 2013-03-12
4356======================
4357
4358 * refactor; rename private methods to something unusable as doc properties
4359 * added; {mongoose,db}.modelNames()
4360 * added; $push w/ $slice,$sort support (MongoDB 2.4)
4361 * added; hashed index type (MongoDB 2.4)
4362 * added; support for mongodb 2.4 geojson (MongoDB 2.4)
4363 * added; value at time of validation error
4364 * added; support for object literal schemas
4365 * added; bufferCommands schema option
4366 * added; allow auth option in connections #1360 [geoah](https://github.com/geoah)
4367 * fixed; lean population #1382
4368 * fixed; empty object mixed defaults #1380
4369 * fixed; populate w/ deselected _id using string syntax
4370 * fixed; attempted save of divergent populated arrays #1334 related
4371 * fixed; better error msg when attempting toObject as property name
4372 * fixed; non population buffer casting from doc
4373 * fixed; setting populated paths #570
4374 * fixed; casting when added docs to populated arrays #570
4375 * fixed; prohibit updating arrays selected with $elemMatch #1334
4376 * fixed; pull / set subdoc combination #1303
4377 * fixed; multiple bg index creation #1365
4378 * fixed; manual reconnection to single mongod
4379 * fixed; Constructor / version exposure #1124
4380 * fixed; CastError race condition
4381 * fixed; no longer swallowing misuse of subdoc#invalidate()
4382 * fixed; utils.clone retains RegExp opts
4383 * fixed; population of non-schema property
4384 * fixed; allow updating versionKey #1265
4385 * fixed; add EventEmitter props to reserved paths #1338
4386 * fixed; can now deselect populated doc _ids #1331
4387 * updated; muri to 0.3.1
4388 * updated; driver to 1.2.12
4389 * updated; mpromise to 0.2.1
4390 * deprecated; pluralization will die in 4.x
4391 * docs; Buffer -> mongodb.Binary #1363
4392 * docs; auth options
4393 * docs; improved
4394 * website; add news section
4395 * benchmark; make adjustable
4396
43973.6.0rc0 / 2013-02-03
4398======================
4399
4400 * changed; cast 'true'/'false' to boolean #1282 [mgrach](https://github.com/mgrach)
4401 * changed; Buffer arrays can now contain nulls
4402 * fixed; properly pass subtype to Binary in MongooseBuffer
4403 * fixed; casting _id from document with non-ObjectId _id
4404 * fixed; specifying schema type edge case { path: [{type: "String" }] }
4405 * fixed; typo in schemdate #1329 [jplock](https://github.com/jplock)
4406 * refactor; move expires index to SchemaDate #1328
4407 * refactor; internal document properties #1171 #1184
4408 * added; performance improvements to populate() [263ece9](https://github.com/LearnBoost/mongoose/commit/263ece9)
4409 * added; allow adding uncasted docs to populated arrays and properties #570
4410 * added; doc#populated(path) stores original populated _ids
4411 * added; lean population #1260
4412 * added; query.populate() now accepts an options object
4413 * added; document#populate(opts, callback)
4414 * added; Model.populate(docs, opts, callback)
4415 * added; support for rich nested path population
4416 * added; doc.array.remove(value) subdoc with _id value support #1278
4417 * added; optionally allow non-strict sets and updates
4418 * added; promises/A+ comformancy with [mpromise](https://github.com/aheckmann/mpromise)
4419 * added; promise#then
4420 * added; promise#end
4421 * updated; mocha 1.8.1
4422 * updated; muri to 0.3.0
4423 * updated; mpath to 0.1.1
4424 * updated; docs
4425
44263.5.16 / 2013-08-13
4427===================
4428
4429 * updated; driver to 1.3.18
4430
44313.5.15 / 2013-07-26
4432==================
4433
4434 * updated; sliced to 0.0.5
4435 * updated; driver to 1.3.12
4436 * fixed; regression in Query#count() due to driver change
4437 * tests; fixed timeouts
4438 * tests; handle differing test uris
4439
44403.5.14 / 2013-05-15
4441===================
4442
4443 * updated; driver to 1.3.5
4444 * fixed; compat w/ Object.create(null) #1484 #1485
4445 * fixed; cloning objects missing constructors
4446 * fixed; prevent multiple min number validators #1481 [nrako](https://github.com/nrako)
4447
44483.5.13 / 2013-05-09
4449==================
4450
4451 * update driver to 1.3.3
4452 * fixed; use of $options in array #1462
4453
44543.5.12 / 2013-04-25
4455===================
4456
4457 * updated; driver to 1.3.0
4458 * fixed; connection.model should retain options #1458 [vedmalex](https://github.com/vedmalex)
4459 * fixed; read pref typos #1422 [kyano](https://github.com/kyano)
4460
44613.5.11 / 2013-04-03
4462==================
4463
4464 * fixed; +field conflict with $slice #1370
4465 * fixed; RangeError in ValidationError.toString() #1296
4466 * fixed; nested deselection conflict #1333
4467 * remove time from Makefile
4468
44693.5.10 / 2013-04-02
4470==================
4471
4472 * fixed; setting subdocuments deeply nested fields #1394
4473 * fixed; do not alter schema arguments #1364
4474
44753.5.9 / 2013-03-15
4476==================
4477
4478 * updated; driver to 1.2.14
4479 * added; support for authSource driver option (mongodb 2.4)
4480 * added; QueryStream transform option (node 0.10 helper)
4481 * fixed; backport for saving required populated buffers
4482 * fixed; pull / set subdoc combination #1303
4483 * fixed; multiple bg index creation #1365
4484 * test; added for saveable required populated buffers
4485 * test; added for #1365
4486 * test; add authSource test
4487
44883.5.8 / 2013-03-12
4489==================
4490
4491 * added; auth option in connection [geoah](https://github.com/geoah)
4492 * fixed; CastError race condition
4493 * docs; add note about stream compatibility with node 0.8
4494
44953.5.7 / 2013-02-22
4496==================
4497
4498 * updated; driver to 1.2.13
4499 * updated; muri to 0.3.1 #1347
4500 * fixed; utils.clone retains RegExp opts #1355
4501 * fixed; deepEquals RegExp support
4502 * tests; fix a connection test
4503 * website; clean up docs [afshinm](https://github.com/afshinm)
4504 * website; update homepage
4505 * website; migragtion: emphasize impact of strict docs #1264
4506
45073.5.6 / 2013-02-14
4508==================
4509
4510 * updated; driver to 1.2.12
4511 * fixed; properly pass Binary subtype
4512 * fixed; add EventEmitter props to reserved paths #1338
4513 * fixed; use correct node engine version
4514 * fixed; display empty docs as {} in log output #953 follow up
4515 * improved; "bad $within $box argument" error message
4516 * populate; add unscientific benchmark
4517 * website; add stack overflow to help section
4518 * website; use better code font #1336 [risseraka](https://github.com/risseraka)
4519 * website; clarify where help is available
4520 * website; fix source code links #1272 [floatingLomas](https://github.com/floatingLomas)
4521 * docs; be specific about _id schema option #1103
4522 * docs; add ensureIndex error handling example
4523 * docs; README
4524 * docs; CONTRIBUTING.md
4525
45263.5.5 / 2013-01-29
4527==================
4528
4529 * updated; driver to 1.2.11
4530 * removed; old node < 0.6x shims
4531 * fixed; documents with Buffer _ids equality
4532 * fixed; MongooseBuffer properly casts numbers
4533 * fixed; reopening closed connection on alt host/port #1287
4534 * docs; fixed typo in Readme #1298 [rened](https://github.com/rened)
4535 * docs; fixed typo in migration docs [Prinzhorn](https://github.com/Prinzhorn)
4536 * docs; fixed incorrect annotation in SchemaNumber#min [bilalq](https://github.com/bilalq)
4537 * docs; updated
4538
45393.5.4 / 2013-01-07
4540==================
4541
4542 * changed; "_pres" & "_posts" are now reserved pathnames #1261
4543 * updated; driver to 1.2.8
4544 * fixed; exception when reopening a replica set. #1263 [ethankan](https://github.com/ethankan)
4545 * website; updated
4546
45473.5.3 / 2012-12-26
4548==================
4549
4550 * added; support for geo object notation #1257
4551 * fixed; $within query casting with arrays
4552 * fixed; unix domain socket support #1254
4553 * updated; driver to 1.2.7
4554 * updated; muri to 0.0.5
4555
45563.5.2 / 2012-12-17
4557==================
4558
4559 * fixed; using auth with replica sets #1253
4560
45613.5.1 / 2012-12-12
4562==================
4563
4564 * fixed; regression when using subdoc with `path` as pathname #1245 [daeq](https://github.com/daeq)
4565 * fixed; safer db option checks
4566 * updated; driver to 1.2.5
4567 * website; add more examples
4568 * website; clean up old docs
4569 * website; fix prev release urls
4570 * docs; clarify streaming with HTTP responses
4571
45723.5.0 / 2012-12-10
4573==================
4574
4575 * added; paths to CastErrors #1239
4576 * added; support for mongodb connection string spec #1187
4577 * added; post validate event
4578 * added; Schema#get (to retrieve schema options)
4579 * added; VersionError #1071
4580 * added; npmignore [hidekiy](https://github.com/hidekiy)
4581 * update; driver to 1.2.3
4582 * fixed; stackoverflow in setter #1234
4583 * fixed; utils.isObject()
4584 * fixed; do not clobber user specified driver writeConcern #1227
4585 * fixed; always pass current document to post hooks
4586 * fixed; throw error when user attempts to overwrite a model
4587 * fixed; connection.model only caches on connection #1209
4588 * fixed; respect conn.model() creation when matching global model exists #1209
4589 * fixed; passing model name + collection name now always honors collection name
4590 * fixed; setting virtual field to an empty object #1154
4591 * fixed; subclassed MongooseErrors exposure, now available in mongoose.Error.xxxx
4592 * fixed; model.remove() ignoring callback when executed twice [daeq](https://github.com/daeq) #1210
4593 * docs; add collection option to schema api docs #1222
4594 * docs; NOTE about db safe options
4595 * docs; add post hooks docs
4596 * docs; connection string options
4597 * docs; middleware is not executed with Model.remove #1241
4598 * docs; {g,s}etter introspection #777
4599 * docs; update validation docs
4600 * docs; add link to plugins page
4601 * docs; clarify error returned by unique indexes #1225
4602 * docs; more detail about disabling autoIndex behavior
4603 * docs; add homepage section to package (npm docs mongoose)
4604 * docs; more detail around collection name pluralization #1193
4605 * website; add .important css
4606 * website; update models page
4607 * website; update getting started
4608 * website; update quick start
4609
46103.4.0 / 2012-11-10
4611==================
4612
4613 * added; support for generic toJSON/toObject transforms #1160 #1020 #1197
4614 * added; doc.set() merge support #1148 [NuORDER](https://github.com/NuORDER)
4615 * added; query#add support #1188 [aleclofabbro](https://github.com/aleclofabbro)
4616 * changed; adding invalid nested paths to non-objects throws 4216f14
4617 * changed; fixed; stop invalid function cloning (internal fix)
4618 * fixed; add query $and casting support #1180 [anotheri](https://github.com/anotheri)
4619 * fixed; overwriting of query arguments #1176
4620 * docs; fix expires examples
4621 * docs; transforms
4622 * docs; schema `collection` option docs [hermanjunge](https://github.com/hermanjunge)
4623 * website; updated
4624 * tests; added
4625
46263.3.1 / 2012-10-11
4627==================
4628
4629 * fixed; allow goose.connect(uris, dbname, opts) #1144
4630 * docs; persist API private checked state across page loads
4631
46323.3.0 / 2012-10-10
4633==================
4634
4635 * fixed; passing options as 2nd arg to connect() #1144
4636 * fixed; race condition after no-op save #1139
4637 * fixed; schema field selection application in findAndModify #1150
4638 * fixed; directly setting arrays #1126
4639 * updated; driver to 1.1.11
4640 * updated; collection pluralization rules [mrickard](https://github.com/mrickard)
4641 * tests; added
4642 * docs; updated
4643
46443.2.2 / 2012-10-08
4645==================
4646
4647 * updated; driver to 1.1.10 #1143
4648 * updated; use sliced 0.0.3
4649 * fixed; do not recast embedded docs unnecessarily
4650 * fixed; expires schema option helper #1132
4651 * fixed; built in string setters #1131
4652 * fixed; debug output for Dates/ObjectId properties #1129
4653 * docs; fixed Javascript syntax error in example [olalonde](https://github.com/olalonde)
4654 * docs; fix toJSON example #1137
4655 * docs; add ensureIndex production notes
4656 * docs; fix spelling
4657 * docs; add blogposts about v3
4658 * website; updated
4659 * removed; undocumented inGroupsOf util
4660 * tests; added
4661
46623.2.1 / 2012-09-28
4663==================
4664
4665 * fixed; remove query batchSize option default of 1000 https://github.com/learnboost/mongoose/commit/3edaa8651
4666 * docs; updated
4667 * website; updated
4668
46693.2.0 / 2012-09-27
4670==================
4671
4672 * added; direct array index assignment with casting support `doc.array.set(index, value)`
4673 * fixed; QueryStream#resume within same tick as pause() #1116
4674 * fixed; default value validatation #1109
4675 * fixed; array splice() not casting #1123
4676 * fixed; default array construction edge case #1108
4677 * fixed; query casting for inequalities in arrays #1101 [dpatti](https://github.com/dpatti)
4678 * tests; added
4679 * website; more documentation
4680 * website; fixed layout issue #1111 [SlashmanX](https://github.com/SlashmanX)
4681 * website; refactored [guille](https://github.com/guille)
4682
46833.1.2 / 2012-09-10
4684==================
4685
4686 * added; ReadPreferrence schema option #1097
4687 * updated; driver to 1.1.7
4688 * updated; default query batchSize to 1000
4689 * fixed; we now cast the mapReduce query option #1095
4690 * fixed; $elemMatch+$in with field selection #1091
4691 * fixed; properly cast $elemMatch+$in conditions #1100
4692 * fixed; default field application of subdocs #1027
4693 * fixed; querystream prematurely dying #1092
4694 * fixed; querystream never resumes when paused at getMore boundries #1092
4695 * fixed; querystream occasionally emits data events after destroy #1092
4696 * fixed; remove unnecessary ObjectId creation in querystream
4697 * fixed; allow ne(boolean) again #1093
4698 * docs; add populate/field selection syntax notes
4699 * docs; add toObject/toJSON options detail
4700 * docs; `read` schema option
4701
47023.1.1 / 2012-08-31
4703==================
4704
4705 * updated; driver to 1.1.6
4706
47073.1.0 / 2012-08-29
4708==================
4709
4710 * changed; fixed; directly setting nested objects now overwrites entire object (previously incorrectly merged them)
4711 * added; read pref support (mongodb 2.2) 205a709c
4712 * added; aggregate support (mongodb 2.2) f3a5bd3d
4713 * added; virtual {g,s}etter introspection (#1070)
4714 * updated; docs [brettz9](https://github.com/brettz9)
4715 * updated; driver to 1.1.5
4716 * fixed; retain virtual setter return values (#1069)
4717
47183.0.3 / 2012-08-23
4719==================
4720
4721 * fixed; use of nested paths beginning w/ numbers #1062
4722 * fixed; query population edge case #1053 #1055 [jfremy](https://github.com/jfremy)
4723 * fixed; simultaneous top and sub level array modifications #1073
4724 * added; id and _id schema option aliases + tests
4725 * improve debug formatting to allow copy/paste logged queries into mongo shell [eknkc](https://github.com/eknkc)
4726 * docs
4727
47283.0.2 / 2012-08-17
4729==================
4730
4731 * added; missing support for v3 sort/select syntax to findAndModify helpers (#1058)
4732 * fixed; replset fullsetup event emission
4733 * fixed; reconnected event for replsets
4734 * fixed; server reconnection setting discovery
4735 * fixed; compat with non-schema path props using positional notation (#1048)
4736 * fixed; setter/casting order (#665)
4737 * docs; updated
4738
47393.0.1 / 2012-08-11
4740==================
4741
4742 * fixed; throw Error on bad validators (1044)
4743 * fixed; typo in EmbeddedDocument#parentArray [lackac]
4744 * fixed; repair mongoose.SchemaTypes alias
4745 * updated; docs
4746
47473.0.0 / 2012-08-07
4748==================
4749
4750 * removed; old subdocument#commit method
4751 * fixed; setting arrays of matching docs [6924cbc2]
4752 * fixed; doc!remove event now emits in save order as save for consistency
4753 * fixed; pre-save hooks no longer fire on subdocuments when validation fails
4754 * added; subdoc#parent() and subdoc#parentArray() to access subdocument parent objects
4755 * added; query#lean() helper
4756
47573.0.0rc0 / 2012-08-01
4758=====================
4759
4760 * fixed; allow subdoc literal declarations containing "type" pathname (#993)
4761 * fixed; unsetting a default array (#758)
4762 * fixed; boolean $in queries (#998)
4763 * fixed; allow use of `options` as a pathname (#529)
4764 * fixed; `model` is again a permitted schema path name
4765 * fixed; field selection option on subdocs (#1022)
4766 * fixed; handle another edge case with subdoc saving (#975)
4767 * added; emit save err on model if listening
4768 * added; MongoDB TTL collection support (#1006)
4769 * added; $center options support
4770 * added; $nearSphere and $polygon support
4771 * updated; driver version to 1.1.2
4772
47733.0.0alpha2 / 2012-07-18
4774=========================
4775
4776 * changed; index errors are now emitted on their model and passed to an optional callback (#984)
4777 * fixed; specifying index along with sparse/unique option no longer overwrites (#1004)
4778 * fixed; never swallow connection errors (#618)
4779 * fixed; creating object from model with emded object no longer overwrites defaults [achurkin] (#859)
4780 * fixed; stop needless validation of unchanged/unselected fields (#891)
4781 * fixed; document#equals behavior of objectids (#974)
4782 * fixed; honor the minimize schema option (#978)
4783 * fixed; provide helpful error msgs when reserved schema path is used (#928)
4784 * fixed; callback to conn#disconnect is optional (#875)
4785 * fixed; handle missing protocols in connection urls (#987)
4786 * fixed; validate args to query#where (#969)
4787 * fixed; saving modified/removed subdocs (#975)
4788 * fixed; update with $pull from Mixed array (#735)
4789 * fixed; error with null shard key value
4790 * fixed; allow unsetting enums (#967)
4791 * added; support for manual index creation (#984)
4792 * added; support for disabled auto-indexing (#984)
4793 * added; support for preserving MongooseArray#sort changes (#752)
4794 * added; emit state change events on connection
4795 * added; support for specifying BSON subtype in MongooseBuffer#toObject [jcrugzz]
4796 * added; support for disabled versioning (#977)
4797 * added; implicit "new" support for models and Schemas
4798
47993.0.0alpha1 / 2012-06-15
4800=========================
4801
4802 * removed; doc#commit (use doc#markModified)
4803 * removed; doc.modified getter (#950)
4804 * removed; mongoose{connectSet,createSetConnection}. use connect,createConnection instead
4805 * removed; query alias methods 1149804c
4806 * removed; MongooseNumber
4807 * changed; now creating indexes in background by default
4808 * changed; strict mode now enabled by default (#952)
4809 * changed; doc#modifiedPaths is now a method (#950)
4810 * changed; getters no longer cast (#820); casting happens during set
4811 * fixed; no need to pass updateArg to findOneAndUpdate (#931)
4812 * fixed: utils.merge bug when merging nested non-objects. [treygriffith]
4813 * fixed; strict:throw should produce errors in findAndModify (#963)
4814 * fixed; findAndUpdate no longer overwrites document (#962)
4815 * fixed; setting default DocumentArrays (#953)
4816 * fixed; selection of _id with schema deselection (#954)
4817 * fixed; ensure promise#error emits instanceof Error
4818 * fixed; CursorStream: No stack overflow on any size result (#929)
4819 * fixed; doc#remove now passes safe options
4820 * fixed; invalid use of $set during $pop
4821 * fixed; array#{$pop,$shift} mirror MongoDB behavior
4822 * fixed; no longer test non-required vals in string match (#934)
4823 * fixed; edge case with doc#inspect
4824 * fixed; setter order (#665)
4825 * fixed; setting invalid paths in strict mode (#916)
4826 * fixed; handle docs without id in DocumentArray#id method (#897)
4827 * fixed; do not save virtuals during model.update (#894)
4828 * fixed; sub doc toObject virtuals application (#889)
4829 * fixed; MongooseArray#pull of ObjectId (#881)
4830 * fixed; handle passing db name with any repl set string
4831 * fixed; default application of selected fields (#870)
4832 * fixed; subdoc paths reported in validation errors (#725)
4833 * fixed; incorrect reported num of affected docs in update ops (#862)
4834 * fixed; connection assignment in Model#model (#853)
4835 * fixed; stringifying arrays of docs (#852)
4836 * fixed; modifying subdoc and parent array works (#842)
4837 * fixed; passing undefined to next hook (#785)
4838 * fixed; Query#{update,remove}() works without callbacks (#788)
4839 * fixed; set/updating nested objects by parent pathname (#843)
4840 * fixed; allow null in number arrays (#840)
4841 * fixed; isNew on sub doc after insertion error (#837)
4842 * fixed; if an insert fails, set isNew back to false [boutell]
4843 * fixed; isSelected when only _id is selected (#730)
4844 * fixed; setting an unset default value (#742)
4845 * fixed; query#sort error messaging (#671)
4846 * fixed; support for passing $options with $regex
4847 * added; array of object literal notation in schema creates DocumentArrays
4848 * added; gt,gte,lt,lte query support for arrays (#902)
4849 * added; capped collection support (#938)
4850 * added; document versioning support
4851 * added; inclusion of deselected schema path (#786)
4852 * added; non-atomic array#pop
4853 * added; EmbeddedDocument constructor is now exposed in DocArray#create 7cf8beec
4854 * added; mapReduce support (#678)
4855 * added; support for a configurable minimize option #to{Object,JSON}(option) (#848)
4856 * added; support for strict: `throws` [regality]
4857 * added; support for named schema types (#795)
4858 * added; to{Object,JSON} schema options (#805)
4859 * added; findByIdAnd{Update,Remove}()
4860 * added; findOneAnd{Update,Remove}()
4861 * added; query.setOptions()
4862 * added; instance.update() (#794)
4863 * added; support specifying model in populate() [DanielBaulig]
4864 * added; `lean` query option [gitfy]
4865 * added; multi-atomic support to MongooseArray#nonAtomicPush
4866 * added; support for $set + other $atomic ops on single array
4867 * added; tests
4868 * updated; driver to 1.0.2
4869 * updated; query.sort() syntax to mirror query.select()
4870 * updated; clearer cast error msg for array numbers
4871 * updated; docs
4872 * updated; doc.clone 3x faster (#950)
4873 * updated; only create _id if necessary (#950)
4874
48752.7.3 / 2012-08-01
4876==================
4877
4878 * fixed; boolean $in queries (#998)
4879 * fixed field selection option on subdocs (#1022)
4880
48812.7.2 / 2012-07-18
4882==================
4883
4884 * fixed; callback to conn#disconnect is optional (#875)
4885 * fixed; handle missing protocols in connection urls (#987)
4886 * fixed; saving modified/removed subdocs (#975)
4887 * updated; tests
4888
48892.7.1 / 2012-06-26
4890===================
4891
4892 * fixed; sharding: when a document holds a null as a value of the shard key
4893 * fixed; update() using $pull on an array of Mixed (gh-735)
4894 * deprecated; MongooseNumber#{inc, increment, decrement} methods
4895 * tests; now using mocha
4896
48972.7.0 / 2012-06-14
4898===================
4899
4900 * added; deprecation warnings to methods being removed in 3.x
4901
49022.6.8 / 2012-06-14
4903===================
4904
4905 * fixed; edge case when using 'options' as a path name (#961)
4906
49072.6.7 / 2012-06-08
4908===================
4909
4910 * fixed; ensure promise#error always emits instanceof Error
4911 * fixed; selection of _id w/ another excluded path (#954)
4912 * fixed; setting default DocumentArrays (#953)
4913
49142.6.6 / 2012-06-06
4915===================
4916
4917 * fixed; stack overflow in query stream with large result sets (#929)
4918 * added; $gt, $gte, $lt, $lte support to arrays (#902)
4919 * fixed; pass option `safe` along to doc#remove() calls
4920
49212.6.5 / 2012-05-24
4922===================
4923
4924 * fixed; do not save virtuals in Model.update (#894)
4925 * added; missing $ prefixed query aliases (going away in 3.x) (#884) [timoxley]
4926 * fixed; setting invalid paths in strict mode (#916)
4927 * fixed; resetting isNew after insert failure (#837) [boutell]
4928
49292.6.4 / 2012-05-15
4930===================
4931
4932 * updated; backport string regex $options to 2.x
4933 * updated; use driver 1.0.2 (performance improvements) (#914)
4934 * fixed; calling MongooseDocumentArray#id when the doc has no _id (#897)
4935
49362.6.3 / 2012-05-03
4937===================
4938
4939 * fixed; repl-set connectivity issues during failover on MongoDB 2.0.1
4940 * updated; driver to 1.0.0
4941 * fixed; virtuals application of subdocs when using toObject({ virtuals: true }) (#889)
4942 * fixed; MongooseArray#pull of ObjectId correctly updates the array itself (#881)
4943
49442.6.2 / 2012-04-30
4945===================
4946
4947 * fixed; default field application of selected fields (#870)
4948
49492.6.1 / 2012-04-30
4950===================
4951
4952 * fixed; connection assignment in mongoose#model (#853, #877)
4953 * fixed; incorrect reported num of affected docs in update ops (#862)
4954
49552.6.0 / 2012-04-19
4956===================
4957
4958 * updated; hooks.js to 0.2.1
4959 * fixed; issue with passing undefined to a hook callback. thanks to [chrisleishman] for reporting.
4960 * fixed; updating/setting nested objects in strict schemas (#843) as reported by [kof]
4961 * fixed; Query#{update,remove}() work without callbacks again (#788)
4962 * fixed; modifying subdoc along with parent array $atomic op (#842)
4963
49642.5.14 / 2012-04-13
4965===================
4966
4967 * fixed; setting an unset default value (#742)
4968 * fixed; doc.isSelected(otherpath) when only _id is selected (#730)
4969 * updated; docs
4970
49712.5.13 / 2012-03-22
4972===================
4973
4974 * fixed; failing validation of unselected required paths (#730,#713)
4975 * fixed; emitting connection error when only one listener (#759)
4976 * fixed; MongooseArray#splice was not returning values (#784) [chrisleishman]
4977
49782.5.12 / 2012-03-21
4979===================
4980
4981 * fixed; honor the `safe` option in all ensureIndex calls
4982 * updated; node-mongodb-native driver to 0.9.9-7
4983
49842.5.11 / 2012-03-15
4985===================
4986
4987 * added; introspection for getters/setters (#745)
4988 * updated; node-mongodb-driver to 0.9.9-5
4989 * added; tailable method to Query (#769) [holic]
4990 * fixed; Number min/max validation of null (#764) [btamas]
4991 * added; more flexible user/password connection options (#738) [KarneAsada]
4992
49932.5.10 / 2012-03-06
4994===================
4995
4996 * updated; node-mongodb-native driver to 0.9.9-4
4997 * added; Query#comment()
4998 * fixed; allow unsetting arrays
4999 * fixed; hooking the set method of subdocuments (#746)
5000 * fixed; edge case in hooks
5001 * fixed; allow $id and $ref in queries (fixes compatibility with mongoose-dbref) (#749) [richtera]
5002 * added; default path selection to SchemaTypes
5003
50042.5.9 / 2012-02-22
5005===================
5006
5007 * fixed; properly cast nested atomic update operators for sub-documents
5008
50092.5.8 / 2012-02-21
5010===================
5011
5012 * added; post 'remove' middleware includes model that was removed (#729) [timoxley]
5013
50142.5.7 / 2012-02-09
5015===================
5016
5017 * fixed; RegExp validators on node >= v0.6.x
5018
50192.5.6 / 2012-02-09
5020===================
5021
5022 * fixed; emit errors returned from db.collection() on the connection (were being swallowed)
5023 * added; can add multiple validators in your schema at once (#718) [diogogmt]
5024 * fixed; strict embedded documents (#717)
5025 * updated; docs [niemyjski]
5026 * added; pass number of affected docs back in model.update/save
5027
50282.5.5 / 2012-02-03
5029===================
5030
5031 * fixed; RangeError: maximum call stack exceed error when removing docs with Number _id (#714)
5032
50332.5.4 / 2012-02-03
5034===================
5035
5036 * fixed; RangeError: maximum call stack exceed error (#714)
5037
50382.5.3 / 2012-02-02
5039===================
5040
5041 * added; doc#isSelected(path)
5042 * added; query#equals()
5043 * added; beta sharding support
5044 * added; more descript error msgs (#700) [obeleh]
5045 * added; document.modifiedPaths (#709) [ljharb]
5046 * fixed; only functions can be added as getters/setters (#707,704) [ljharb]
5047
50482.5.2 / 2012-01-30
5049===================
5050
5051 * fixed; rollback -native driver to 0.9.7-3-5 (was causing timeouts and other replica set weirdness)
5052 * deprecated; MongooseNumber (will be moved to a separate repo for 3.x)
5053 * added; init event is emitted on schemas
5054
50552.5.1 / 2012-01-27
5056===================
5057
5058 * fixed; honor strict schemas in Model.update (#699)
5059
50602.5.0 / 2012-01-26
5061===================
5062
5063 * added; doc.toJSON calls toJSON on embedded docs when exists [jerem]
5064 * added; populate support for refs of type Buffer (#686) [jerem]
5065 * added; $all support for ObjectIds and Dates (#690)
5066 * fixed; virtual setter calling on instantiation when strict: true (#682) [hunterloftis]
5067 * fixed; doc construction triggering getters (#685)
5068 * fixed; MongooseBuffer check in deepEquals (#688)
5069 * fixed; range error when using Number _ids with `instance.save()` (#691)
5070 * fixed; isNew on embedded docs edge case (#680)
5071 * updated; driver to 0.9.8-3
5072 * updated; expose `model()` method within static methods
5073
50742.4.10 / 2012-01-10
5075===================
5076
5077 * added; optional getter application in .toObject()/.toJSON() (#412)
5078 * fixed; nested $operators in $all queries (#670)
5079 * added; $nor support (#674)
5080 * fixed; bug when adding nested schema (#662) [paulwe]
5081
50822.4.9 / 2012-01-04
5083===================
5084
5085 * updated; driver to 0.9.7-3-5 to fix Linux performance degradation on some boxes
5086
50872.4.8 / 2011-12-22
5088===================
5089
5090 * updated; bump -native to 0.9.7.2-5
5091 * fixed; compatibility with date.js (#646) [chrisleishman]
5092 * changed; undocumented schema "lax" option to "strict"
5093 * fixed; default value population for strict schemas
5094 * updated; the nextTick helper for small performance gain. 1bee2a2
5095
50962.4.7 / 2011-12-16
5097===================
5098
5099 * fixed; bug in 2.4.6 with path setting
5100 * updated; bump -native to 0.9.7.2-1
5101 * added; strict schema option [nw]
5102
51032.4.6 / 2011-12-16
5104===================
5105
5106 * fixed; conflicting mods on update bug [sirlantis]
5107 * improved; doc.id getter performance
5108
51092.4.5 / 2011-12-14
5110===================
5111
5112 * fixed; bad MongooseArray behavior in 2.4.2 - 2.4.4
5113
51142.4.4 / 2011-12-14
5115===================
5116
5117 * fixed; MongooseArray#doAtomics throwing after sliced
5118
51192.4.3 / 2011-12-14
5120===================
5121
5122 * updated; system.profile schema for MongoDB 2x
5123
51242.4.2 / 2011-12-12
5125===================
5126
5127 * fixed; partially populating multiple children of subdocs (#639) [kenpratt]
5128 * fixed; allow Update of numbers to null (#640) [jerem]
5129
51302.4.1 / 2011-12-02
5131===================
5132
5133 * added; options support for populate() queries
5134 * updated; -native driver to 0.9.7-1.4
5135
51362.4.0 / 2011-11-29
5137===================
5138
5139 * added; QueryStreams (#614)
5140 * added; debug print mode for development
5141 * added; $within support to Array queries (#586) [ggoodale]
5142 * added; $centerSphere query support
5143 * fixed; $within support
5144 * added; $unset is now used when setting a path to undefined (#519)
5145 * added; query#batchSize support
5146 * updated; docs
5147 * updated; -native driver to 0.9.7-1.3 (provides Windows support)
5148
51492.3.13 / 2011-11-15
5150===================
5151
5152 * fixed; required validation for Refs (#612) [ded]
5153 * added; $nearSphere support for Arrays (#610)
5154
51552.3.12 / 2011-11-09
5156===================
5157
5158 * fixed; regression, objects passed to Model.update should not be changed (#605)
5159 * fixed; regression, empty Model.update should not be executed
5160
51612.3.11 / 2011-11-08
5162===================
5163
5164 * fixed; using $elemMatch on arrays of Mixed types (#591)
5165 * fixed; allow using $regex when querying Arrays (#599)
5166 * fixed; calling Model.update with no atomic keys (#602)
5167
51682.3.10 / 2011-11-05
5169===================
5170
5171 * fixed; model.update casting for nested paths works (#542)
5172
51732.3.9 / 2011-11-04
5174==================
5175
5176 * fixed; deepEquals check for MongooseArray returned false
5177 * fixed; reset modified flags of embedded docs after save [gitfy]
5178 * fixed; setting embedded doc with identical values no longer marks modified [gitfy]
5179 * updated; -native driver to 0.9.6.23 [mlazarov]
5180 * fixed; Model.update casting (#542, #545, #479)
5181 * fixed; populated refs no longer fail required validators (#577)
5182 * fixed; populating refs of objects with custom ids works
5183 * fixed; $pop & $unset work with Model.update (#574)
5184 * added; more helpful debugging message for Schema#add (#578)
5185 * fixed; accessing .id when no _id exists now returns null (#590)
5186
51872.3.8 / 2011-10-26
5188==================
5189
5190 * added; callback to query#findOne is now optional (#581)
5191
51922.3.7 / 2011-10-24
5193==================
5194
5195 * fixed; wrapped save/remove callbacks in nextTick to mitigate -native swallowing thrown errors
5196
51972.3.6 / 2011-10-21
5198==================
5199
5200 * fixed; exclusion of embedded doc _id from query results (#541)
5201
52022.3.5 / 2011-10-19
5203==================
5204
5205 * fixed; calling queries without passing a callback works (#569)
5206 * fixed; populate() works with String and Number _ids too (#568)
5207
52082.3.4 / 2011-10-18
5209==================
5210
5211 * added; Model.create now accepts an array as a first arg
5212 * fixed; calling toObject on a DocumentArray with nulls no longer throws
5213 * fixed; calling inspect on a DocumentArray with nulls no longer throws
5214 * added; MongooseArray#unshift support
5215 * fixed; save hooks now fire on embedded documents [gitfy] (#456)
5216 * updated; -native driver to 0.9.6-22
5217 * fixed; correctly pass $addToSet op instead of $push
5218 * fixed; $addToSet properly detects dates
5219 * fixed; $addToSet with multiple items works
5220 * updated; better node 0.6 Buffer support
5221
52222.3.3 / 2011-10-12
5223==================
5224
5225 * fixed; population conditions in multi-query settings [vedmalex] (#563)
5226 * fixed; now compatible with Node v0.5.x
5227
52282.3.2 / 2011-10-11
5229==================
5230
5231 * fixed; population of null subdoc properties no longer hangs (#561)
5232
52332.3.1 / 2011-10-10
5234==================
5235
5236 * added; support for Query filters to populate() [eneko]
5237 * fixed; querying with number no longer crashes mongodb (#555) [jlbyrey]
5238 * updated; version of -native driver to 0.9.6-21
5239 * fixed; prevent query callbacks that throw errors from corrupting -native connection state
5240
52412.3.0 / 2011-10-04
5242==================
5243
5244 * fixed; nulls as default values for Boolean now works as expected
5245 * updated; version of -native driver to 0.9.6-20
5246
52472.2.4 / 2011-10-03
5248==================
5249
5250 * fixed; populate() works when returned array contains undefined/nulls
5251
52522.2.3 / 2011-09-29
5253==================
5254
5255 * updated; version of -native driver to 0.9.6-19
5256
52572.2.2 / 2011-09-28
5258==================
5259
5260 * added; $regex support to String [davidandrewcope]
5261 * added; support for other contexts like repl etc (#535)
5262 * fixed; clear modified state properly after saving
5263 * added; $addToSet support to Array
5264
52652.2.1 / 2011-09-22
5266==================
5267
5268 * more descript error when casting undefined to string
5269 * updated; version of -native driver to 0.9.6-18
5270
52712.2.0 / 2011-09-22
5272==================
5273
5274 * fixed; maxListeners warning on schemas with many arrays (#530)
5275 * changed; return / apply defaults based on fields selected in query (#423)
5276 * fixed; correctly detect Mixed types within schema arrays (#532)
5277
52782.1.4 / 2011-09-20
5279==================
5280
5281 * fixed; new private methods that stomped on users code
5282 * changed; finished removing old "compat" support which did nothing
5283
52842.1.3 / 2011-09-16
5285==================
5286
5287 * updated; version of -native driver to 0.9.6-15
5288 * added; emit `error` on connection when open fails [edwardhotchkiss]
5289 * added; index support to Buffers (thanks justmoon for helping track this down)
5290 * fixed; passing collection name via schema in conn.model() now works (thanks vedmalex for reporting)
5291
52922.1.2 / 2011-09-07
5293==================
5294
5295 * fixed; Query#find with no args no longer throws
5296
52972.1.1 / 2011-09-07
5298==================
5299
5300 * added; support Model.count(fn)
5301 * fixed; compatibility with node >=0.4.0 < 0.4.3
5302 * added; pass model.options.safe through with .save() so w:2, wtimeout:5000 options work [andrewjstone]
5303 * added; support for $type queries
5304 * added; support for Query#or
5305 * added; more tests
5306 * optimized populate queries
5307
53082.1.0 / 2011-09-01
5309==================
5310
5311 * changed; document#validate is a public method
5312 * fixed; setting number to same value no longer marks modified (#476) [gitfy]
5313 * fixed; Buffers shouldn't have default vals
5314 * added; allow specifying collection name in schema (#470) [ixti]
5315 * fixed; reset modified paths and atomics after saved (#459)
5316 * fixed; set isNew on embedded docs to false after save
5317 * fixed; use self to ensure proper scope of options in doOpenSet (#483) [andrewjstone]
5318
53192.0.4 / 2011-08-29
5320==================
5321
5322 * Fixed; Only send the depopulated ObjectId instead of the entire doc on save (DBRefs)
5323 * Fixed; Properly cast nested array values in Model.update (the data was stored in Mongo incorrectly but recast on document fetch was "fixing" it)
5324
53252.0.3 / 2011-08-28
5326==================
5327
5328 * Fixed; manipulating a populated array no longer causes infinite loop in BSON serializer during save (#477)
5329 * Fixed; populating an empty array no longer hangs foreeeeeeeever (#481)
5330
53312.0.2 / 2011-08-25
5332==================
5333
5334 * Fixed; Maintain query option key order (fixes 'bad hint' error from compound query hints)
5335
53362.0.1 / 2011-08-25
5337==================
5338
5339 * Fixed; do not over-write the doc when no valide props exist in Model.update (#473)
5340
53412.0.0 / 2011-08-24
5342===================
5343
5344 * Added; support for Buffers [justmoon]
5345 * Changed; improved error handling [maelstrom]
5346 * Removed: unused utils.erase
5347 * Fixed; support for passing other context object into Schemas (#234) [Sija]
5348 * Fixed; getters are no longer circular refs to themselves (#366)
5349 * Removed; unused compat.js
5350 * Fixed; getter/setter scopes are set properly
5351 * Changed; made several private properties more obvious by prefixing _
5352 * Added; DBRef support [guille]
5353 * Changed; removed support for multiple collection names per model
5354 * Fixed; no longer applying setters when document returned from db
5355 * Changed; default auto_reconnect to true
5356 * Changed; Query#bind no longer clones the query
5357 * Fixed; Model.update now accepts $pull, $inc and friends (#404)
5358 * Added; virtual type option support [nw]
5359
53601.8.4 / 2011-08-21
5361===================
5362
5363 * Fixed; validation bug when instantiated with non-schema properties (#464) [jmreidy]
5364
53651.8.3 / 2011-08-19
5366===================
5367
5368 * Fixed; regression in connection#open [jshaw86]
5369
53701.8.2 / 2011-08-17
5371===================
5372
5373 * fixed; reset connection.readyState after failure [tomseago]
5374 * fixed; can now query positionally for non-embedded docs (arrays of numbers/strings etc)
5375 * fixed; embedded document query casting
5376 * added; support for passing options to node-mongo-native db, server, and replsetserver [tomseago]
5377
53781.8.1 / 2011-08-10
5379===================
5380
5381 * fixed; ObjectIds were always marked modified
5382 * fixed; can now query using document instances
5383 * fixed; can now query/update using documents with subdocs
5384
53851.8.0 / 2011-08-04
5386===================
5387
5388 * fixed; can now use $all with String and Number
5389 * fixed; can query subdoc array with $ne: null
5390 * fixed; instance.subdocs#id now works with custom _ids
5391 * fixed; do not apply setters when doc returned from db (change in bad behavior)
5392
53931.7.4 / 2011-07-25
5394===================
5395
5396 * fixed; sparse now a valid seperate schema option
5397 * fixed; now catching cast errors in queries
5398 * fixed; calling new Schema with object created in vm.runInNewContext now works (#384) [Sija]
5399 * fixed; String enum was disallowing null
5400 * fixed; Find by nested document _id now works (#389)
5401
54021.7.3 / 2011-07-16
5403===================
5404
5405 * fixed; MongooseArray#indexOf now works with ObjectIds
5406 * fixed; validation scope now set properly (#418)
5407 * fixed; added missing colors dependency (#398)
5408
54091.7.2 / 2011-07-13
5410===================
5411
5412 * changed; node-mongodb-native driver to v0.9.6.7
5413
54141.7.1 / 2011-07-12
5415===================
5416
5417 * changed; roll back node-mongodb-native driver to v0.9.6.4
5418
54191.7.0 / 2011-07-12
5420===================
5421
5422 * fixed; collection name misspelling [mathrawka]
5423 * fixed; 2nd param is required for ReplSetServers [kevinmarvin]
5424 * fixed; MongooseArray behaves properly with Object.keys
5425 * changed; node-mongodb-native driver to v0.9.6.6
5426 * fixed/changed; Mongodb segfault when passed invalid ObjectId (#407)
5427 - This means invalid data passed to the ObjectId constructor will now error
5428
54291.6.0 / 2011-07-07
5430===================
5431
5432 * changed; .save() errors are now emitted on the instances db instead of the instance 9782463fc
5433 * fixed; errors occurring when creating indexes now properly emit on db
5434 * added; $maxDistance support to MongooseArrays
5435 * fixed; RegExps now work with $all
5436 * changed; node-mongodb-native driver to v0.9.6.4
5437 * fixed; model names are now accessible via .modelName
5438 * added; Query#slaveOk support
5439
54401.5.0 / 2011-06-27
5441===================
5442
5443 * changed; saving without a callback no longer ignores the error (@bnoguchi)
5444 * changed; hook-js version bump to 0.1.9
5445 * changed; node-mongodb-native version bumped to 0.9.6.1 - When .remove() doesn't
5446 return an error, null is no longer passed.
5447 * fixed; two memory leaks (@justmoon)
5448 * added; sparse index support
5449 * added; more ObjectId conditionals (gt, lt, gte, lte) (@phillyqueso)
5450 * added; options are now passed in model#remote (@JerryLuke)
5451
54521.4.0 / 2011-06-10
5453===================
5454
5455 * bumped hooks-js dependency (fixes issue passing null as first arg to next())
5456 * fixed; document#inspect now works properly with nested docs
5457 * fixed; 'set' now works as a schema attribute (GH-365)
5458 * fixed; _id is now set properly within pre-init hooks (GH-289)
5459 * added; Query#distinct / Model#distinct support (GH-155)
5460 * fixed; embedded docs now can use instance methods (GH-249)
5461 * fixed; can now overwrite strings conflicting with schema type
5462
54631.3.7 / 2011-06-03
5464===================
5465
5466 * added MongooseArray#splice support
5467 * fixed; 'path' is now a valid Schema pathname
5468 * improved hooks (utilizing https://github.com/bnoguchi/hooks-js)
5469 * fixed; MongooseArray#$shift now works (never did)
5470 * fixed; Document.modified no longer throws
5471 * fixed; modifying subdoc property sets modified paths for subdoc and parent doc
5472 * fixed; marking subdoc path as modified properly persists the value to the db
5473 * fixed; RexExps can again be saved ( #357 )
5474
54751.3.6 / 2011-05-18
5476===================
5477
5478 * fixed; corrected casting for queries against array types
5479 * added; Document#set now accepts Document instances
5480
54811.3.5 / 2011-05-17
5482===================
5483
5484 * fixed; $ne queries work properly with single vals
5485 * added; #inspect() methods to improve console.log output
5486
54871.3.4 / 2011-05-17
5488===================
5489
5490 * fixed; find by Date works as expected (#336)
5491 * added; geospatial 2d index support
5492 * added; support for $near (#309)
5493 * updated; node-mongodb-native driver
5494 * fixed; updating numbers work (#342)
5495 * added; better error msg when try to remove an embedded doc without an _id (#307)
5496 * added; support for 'on-the-fly' schemas (#227)
5497 * changed; virtual id getters can now be skipped
5498 * fixed; .index() called on subdoc schema now works as expected
5499 * fixed; db.setProfile() now buffers until the db is open (#340)
5500
55011.3.3 / 2011-04-27
5502===================
5503
5504 * fixed; corrected query casting on nested mixed types
5505
55061.3.2 / 2011-04-27
5507===================
5508
5509 * fixed; query hints now retain key order
5510
55111.3.1 / 2011-04-27
5512===================
5513
5514 * fixed; setting a property on an embedded array no longer overwrites entire array (GH-310)
5515 * fixed; setting nested properties works when sibling prop is named "type"
5516 * fixed; isModified is now much finer grained when .set() is used (GH-323)
5517 * fixed; mongoose.model() and connection.model() now return the Model (GH-308, GH-305)
5518 * fixed; can now use $gt, $lt, $gte, $lte with String schema types (GH-317)
5519 * fixed; .lowercase() -> .toLowerCase() in pluralize()
5520 * fixed; updating an embedded document by index works (GH-334)
5521 * changed; .save() now passes the instance to the callback (GH-294, GH-264)
5522 * added; can now query system.profile and system.indexes collections
5523 * added; db.model('system.profile') is now included as a default Schema
5524 * added; db.setProfiling(level, ms, callback)
5525 * added; Query#hint() support
5526 * added; more tests
5527 * updated node-mongodb-native to 0.9.3
5528
55291.3.0 / 2011-04-19
5530===================
5531
5532 * changed; save() callbacks now fire only once on failed validation
5533 * changed; Errors returned from save() callbacks now instances of ValidationError
5534 * fixed; MongooseArray#indexOf now works properly
5535
55361.2.0 / 2011-04-11
5537===================
5538
5539 * changed; MongooseNumber now casts empty string to null
5540
55411.1.25 / 2011-04-08
5542===================
5543
5544 * fixed; post init now fires at proper time
5545
55461.1.24 / 2011-04-03
5547===================
5548
5549 * fixed; pushing an array onto an Array works on existing docs
5550
55511.1.23 / 2011-04-01
5552===================
5553
5554 * Added Model#model
5555
55561.1.22 / 2011-03-31
5557===================
5558
5559 * Fixed; $in queries on mixed types now work
5560
55611.1.21 / 2011-03-31
5562===================
5563
5564 * Fixed; setting object root to null/undefined works
5565
55661.1.20 / 2011-03-31
5567===================
5568
5569 * Fixed; setting multiple props on null field works
5570
55711.1.19 / 2011-03-31
5572===================
5573
5574 * Fixed; no longer using $set on paths to an unexisting fields
5575
55761.1.18 / 2011-03-30
5577===================
5578
5579 * Fixed; non-mixed type object setters work after initd from null
5580
55811.1.17 / 2011-03-30
5582===================
5583
5584 * Fixed; nested object property access works when root initd with null value
5585
55861.1.16 / 2011-03-28
5587===================
5588
5589 * Fixed; empty arrays are now saved
5590
55911.1.15 / 2011-03-28
5592===================
5593
5594 * Fixed; `null` and `undefined` are set atomically.
5595
55961.1.14 / 2011-03-28
5597===================
5598
5599 * Changed; more forgiving date casting, accepting '' as null.
5600
56011.1.13 / 2011-03-26
5602===================
5603
5604 * Fixed setting values as `undefined`.
5605
56061.1.12 / 2011-03-26
5607===================
5608
5609 * Fixed; nested objects now convert to JSON properly
5610 * Fixed; setting nested objects directly now works
5611 * Update node-mongodb-native
5612
56131.1.11 / 2011-03-25
5614===================
5615
5616 * Fixed for use of `type` as a key.
5617
56181.1.10 / 2011-03-23
5619===================
5620
5621 * Changed; Make sure to only ensure indexes while connected
5622
56231.1.9 / 2011-03-2
5624==================
5625
5626 * Fixed; Mixed can now default to empty arrays
5627 * Fixed; keys by the name 'type' are now valid
5628 * Fixed; null values retrieved from the database are hydrated as null values.
5629 * Fixed repeated atomic operations when saving a same document twice.
5630
56311.1.8 / 2011-03-23
5632==================
5633
5634 * Fixed 'id' overriding. [bnoguchi]
5635
56361.1.7 / 2011-03-22
5637==================
5638
5639 * Fixed RegExp query casting when querying against an Array of Strings [bnoguchi]
5640 * Fixed getters/setters for nested virtualsl. [bnoguchi]
5641
56421.1.6 / 2011-03-22
5643==================
5644
5645 * Only doValidate when path exists in Schema [aheckmann]
5646 * Allow function defaults for Array types [aheckmann]
5647 * Fix validation hang [aheckmann]
5648 * Fix setting of isRequired of SchemaType [aheckmann]
5649 * Fix SchemaType#required(false) filter [aheckmann]
5650 * More backwards compatibility [aheckmann]
5651 * More tests [aheckmann]
5652
56531.1.5 / 2011-03-14
5654==================
5655
5656 * Added support for `uri, db, fn` and `uri, fn` signatures for replica sets.
5657 * Improved/extended replica set tests.
5658
56591.1.4 / 2011-03-09
5660==================
5661
5662 * Fixed; running an empty Query doesn't throw. [aheckmann]
5663 * Changed; Promise#addBack returns promise. [aheckmann]
5664 * Added streaming cursor support. [aheckmann]
5665 * Changed; Query#update defaults to use$SetOnSave now. [brian]
5666 * Added more docs.
5667
56681.1.3 / 2011-03-04
5669==================
5670
5671 * Added Promise#resolve [aheckmann]
5672 * Fixed backward compatibility with nulls [aheckmann]
5673 * Changed; Query#{run,exec} return promises [aheckmann]
5674
56751.1.2 / 2011-03-03
5676==================
5677
5678 * Restored Query#exec and added notion of default operation [brian]
5679 * Fixed ValidatorError messages [brian]
5680
56811.1.1 / 2011-03-01
5682==================
5683
5684 * Added SchemaType String `lowercase`, `uppercase`, `trim`.
5685 * Public exports (`Model`, `Document`) and tests.
5686 * Added ObjectId casting support for `Document`s.
5687
56881.1.0 / 2011-02-25
5689==================
5690
5691 * Added support for replica sets.
5692
56931.0.16 / 2011-02-18
5694===================
5695
5696 * Added $nin as another whitelisted $conditional for SchemaArray [brian]
5697 * Changed #with to #where [brian]
5698 * Added ability to use $in conditional with Array types [brian]
5699
57001.0.15 / 2011-02-18
5701===================
5702
5703 * Added `id` virtual getter for documents to easily access the hexString of
5704 the `_id`.
5705
57061.0.14 / 2011-02-17
5707===================
5708
5709 * Fix for arrays within subdocuments [brian]
5710
57111.0.13 / 2011-02-16
5712===================
5713
5714 * Fixed embedded documents saving.
5715
57161.0.12 / 2011-02-14
5717===================
5718
5719 * Minor refactorings [brian]
5720
57211.0.11 / 2011-02-14
5722===================
5723
5724 * Query refactor and $ne, $slice, $or, $size, $elemMatch, $nin, $exists support [brian]
5725 * Named scopes sugar [brian]
5726
57271.0.10 / 2011-02-11
5728===================
5729
5730 * Updated node-mongodb-native driver [thanks John Allen]
5731
57321.0.9 / 2011-02-09
5733==================
5734
5735 * Fixed single member arrays as defaults [brian]
5736
57371.0.8 / 2011-02-09
5738==================
5739
5740 * Fixed for collection-level buffering of commands [gitfy]
5741 * Fixed `Document#toJSON` [dalejefferson]
5742 * Fixed `Connection` authentication [robrighter]
5743 * Fixed clash of accessors in getters/setters [eirikurn]
5744 * Improved `Model#save` promise handling
5745
57461.0.7 / 2011-02-05
5747==================
5748
5749 * Fixed memory leak warnings for test suite on 0.3
5750 * Fixed querying documents that have an array that contain at least one
5751 specified member. [brian]
5752 * Fixed default value for Array types (fixes GH-210). [brian]
5753 * Fixed example code.
5754
57551.0.6 / 2011-02-03
5756==================
5757
5758 * Fixed `post` middleware
5759 * Fixed; it's now possible to instantiate a model even when one of the paths maps
5760 to an undefined value [brian]
5761
57621.0.5 / 2011-02-02
5763==================
5764
5765 * Fixed; combo $push and $pushAll auto-converts into a $pushAll [brian]
5766 * Fixed; combo $pull and $pullAll auto-converts to a single $pullAll [brian]
5767 * Fixed; $pullAll now removes said members from array before save (so it acts just
5768 like pushAll) [brian]
5769 * Fixed; multiple $pulls and $pushes become a single $pullAll and $pushAll.
5770 Moreover, $pull now modifies the array before save to reflect the immediate
5771 change [brian]
5772 * Added tests for nested shortcut getters [brian]
5773 * Added tests that show that Schemas with nested Arrays don't apply defaults
5774 [brian]
5775
57761.0.4 / 2011-02-02
5777==================
5778
5779 * Added MongooseNumber#toString
5780 * Added MongooseNumber unit tests
5781
57821.0.3 / 2011-02-02
5783==================
5784
5785 * Make sure safe mode works with Model#save
5786 * Changed Schema options: safe mode is now the default
5787 * Updated node-mongodb-native to HEAD
5788
57891.0.2 / 2011-02-02
5790==================
5791
5792 * Added a Model.create shortcut for creating documents. [brian]
5793 * Fixed; we can now instantiate models with hashes that map to at least one
5794 null value. [brian]
5795 * Fixed Schema with more than 2 nested levels. [brian]
5796
57971.0.1 / 2011-02-02
5798==================
5799
5800 * Improved `MongooseNumber`, works almost like the native except for `typeof`
5801 not being `'number'`.