Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
5.0.7 / 2018-02-23
==================
* fix: support eachAsync options with aggregation cursor #6169 #6168 [vichle](https://github.com/vichle)
* docs: fix link to MongoDB compound indexes docs #6162 [br0p0p](https://github.com/br0p0p)
* docs(aggregate): use eachAsync instead of incorrect `each()` #6160 [simllll](https://github.com/simllll)
* chore: fix benchmarks #6158 [pradel](https://github.com/pradel)
* docs: remove dead link to old blog post #6154 [markstos](https://github.com/markstos)
* fix: don't convert dates to numbers when updating mixed path #6146 #6145 [s4rbagamble](https://github.com/s4rbagamble)
* feat(aggregate): add replaceRoot, count, sortByCount helpers #6142 [jakesjews](https://github.com/jakesjews)
* fix(document): add includedChildren flag to modifiedPaths() #6134
* perf: don't create wrapper function if no hooks specified #6126
* fix(schema): allow indexes on single nested subdocs for geoJSON #6113
* fix(document): allow depopulating all fields #6073
* feat(mongoose): add support for `useFindAndModify` option on singleton #5616
5.0.6 / 2018-02-15
==================
* refactor(query.castUpdate): avoid creating error until necessary #6137
* docs(api): fix missing api docs #6136 [lineus](https://github.com/lineus)
* fix(schema): copy virtuals when using `clone()` #6133
* fix(update): avoid digging into buffers with upsert and replaceOne #6124
* fix(schema): support `enum` on arrays of strings #6102
* fix(update): cast `$addToSet: [1, 2]` -> `$addToSet: { $each: [1, 2] }` #6086
5.0.5 / 2018-02-13
==================
* docs: make > show up correctly in API docs #6114
* fix(query): support `where()` overwriting primitive with object #6097
* fix(schematype): don't run internal `resetId` setter on queries with _id #6093
* fix(discriminator): don't copy `discriminators` property from base schema #6064
* fix(utils): respect `valueOf()` when merging object for update #6059
* docs(validation): fix typo 'maxLength' #4720
* fix(document): apply defaults after setting initial value so default functions don't see empty doc #3781
5.0.4 / 2018-02-08
==================
* docs: add lambda guide #6107
* fix(connection): add `dbName` option to work around `mongodb+srv` not supporting db name in URI #6106
* fix(schematype): fix regexp typo in ObjectId #6098 [JoshuaWise](https://github.com/JoshuaWise)
* perf(document): re-use the modifiedPaths list #6092 [tarun1793](https://github.com/tarun1793)
* fix: use console.info() instead of console.error() for debug output #6088 [yuristsepaniuk](https://github.com/yuristsepaniuk)
* docs(validation): clean up runValidators and isAsync options docs for 5.x #6083
* docs(model): use array instead of spread consistently for aggregate() #6070
* fix(schema): make aliases handle mongoose-lean-virtuals #6069
* docs(layout): add link to subdocs guide #6056
* fix(query): make strictQuery: true strip out fields that aren't in the schema #6032
* docs(guide): add notes for `strictQuery` option #6032
4.13.11 / 2018-02-07
====================
* docs: fix links in 4.x docs #6081
* chore: add release script that uses --tag for npm publish for 4.x releases #6063
5.0.3 / 2018-01-31
==================
* fix: consistently use process.nextTick() to avoid sinon.useFakeTimers() causing ops to hang #6074
* docs(aggregate): fix typo #6072 [adursun](https://github.com/adursun)
* chore: add return type to `mongoose.model()` docs [bryant1410](https://github.com/bryant1410)
* fix(document): depopulate push()-ed docs when saving #6048
* fix: upgrade mongodb -> 3.0.2 #6019
5.0.2 / 2018-01-28
==================
* fix(schema): do not overwrite default values in schema when nested timestamps are provided #6024 [cdeveas](https://github.com/cdeveas)
* docs: fix syntax highlighting in models.jade, schematypes.jade, subdocs.jade #6058 [lineus](https://github.com/lineus)
* fix: use lazy loading so we can build mongoose with webpack #5993 #5842
* docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
* fix(populate): handle populating embedded discriminator paths #5970
4.13.10 / 2018-01-28
====================
* docs(model+query): add lean() option to Model helpers #5996 [aguyinmontreal](https://github.com/aguyinmontreal)
* fix: use lazy loading so we can build mongoose with webpack #5993 #5842
* docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
* fix(populate): handle populating embedded discriminator paths #5970
* docs(query+aggregate): add more detail re: maxTimeMS #4066
5.0.1 / 2018-01-19
==================
* fix(document): make validate() not resolve to document #6014
* fix(model): make save() not return DocumentNotFoundError if using fire-and-forget writes #6012
* fix(aggregate): make options() work as advertised #6011 [spederiva](https://github.com/spederiva)
* docs(queries): fix code samples #6008
5.0.0 / 2018-01-17
==================
* test: refactor tests to use start fewer connections #5985 [fenanquin](https://github.com/fenanquin)
* feat: add global bufferCommands option #5879
* docs: new docs site and build system #5976
* test: increase timeout on slow test cases #5968 [fenanquin](https://github.com/fenanquin)
* fix: avoid casting out array filter elements #5965
* feat: add Model.watch() wrapper #5964
* chore: replace istanbul with nyc #5962 [ChristianMurphy](https://github.com/ChristianMurphy)
4.13.9 / 2018-01-07
===================
* chore: update marked (dev dependency) re: security vulnerability #5951 [ChristianMurphy](https://github.com/ChristianMurphy)
* fix: upgrade mongodb -> 2.2.34 for ipv6 and autoReconnect fixes #5794 #5760
* docs: use useMongooseAggCursor for aggregate docs #2955
5.0.0-rc2 / 2018-01-04
======================
* fix: add cleaner warning about no longer needing `useMongoClient` in 5.x #5961
* chore: update acquit -> 0.5.1 for minor security patch #5961 [ChristianMurphy](https://github.com/ChristianMurphy)
* docs: add docs for mongoose 4.x at http://mongoosejs.com/docs/4.x #5959
* docs: add link to migration guide #5957
* chore: update eslint to version 4.14.0 #5955 [ChristianMurphy](https://github.com/ChristianMurphy)
* chore: update mocha to version 4.1.0 [ChristianMurphy](https://github.com/ChristianMurphy)
5.0.0-rc1 / 2018-01-02
======================
* fix(index): use pluralize correctly for `mongoose.model()` #5958
* fix: make mquery use native promises by default #5945
* fix(connection): ensure 'joined' and 'left' events get bubbled up #5944
5.0.0-rc0 / 2017-12-28
======================
* BREAKING CHANGE: always use mongoose aggregation cursor when using `.aggregate().cursor()` #5941
* BREAKING CHANGE: attach query middleware when compiling model #5939
* BREAKING CHANGE: `emitIndexErrors` is on by default, failing index build will throw uncaught error if not handled #5910
* BREAKING CHANGE: remove precompiled browser bundle #5895
* feat: add `mongoose.pluralize()` function #5877
* BREAKING CHANGE: remove `passRawResult` option for `findOneAndUpdate`, use `rawResult` #5869
* BREAKING CHANGE: implicit async validators (based on number of function args) are removed, return a promise instead #5824
* BREAKING CHANGE: fail fast if user sets a unique index on `_id` #5820 [varunjayaraman](https://github.com/varunjayaraman)
* BREAKING CHANGE: mapReduce resolves to an object with 2 keys rather than 2 separate args #5816
* BREAKING CHANGE: `mongoose.connect()` returns a promise, removed MongooseThenable #5796
* BREAKING CHANGE: query stream removed, use `cursor()` instead #5795
* BREAKING CHANGE: connection `open()` and `openSet()` removed, use `openUri()` instead #5795
* BREAKING CHANGE: use MongoDB driver 3.0.0, drop support for MongoDB server < 3.0.0 #5791 #4740
* BREAKING CHANGE: remove support for `$pushAll`, remove `usePushEach` option #5670
* BREAKING CHANGE: make date casting use native Date #5395 [varunjayaraman](https://github.com/varunjayaraman)
* BREAKING CHANGE: remove `runSettersOnQuery`, always run setters on query #5340
* BREAKING CHANGE: array of length 0 now satisfies `required: true` for arays #5139 [wlingke](https://github.com/wlingke)
* BREAKING CHANGE: remove `saveErrorIfNotFound`, always error out if `save()` did not update a document #4973
* BREAKING CHANGE: don't execute getters in reverse order #4835
* BREAKING CHANGE: make boolean casting more strict #4245
* BREAKING CHANGE: `toObject()` and `toJSON()` option parameter merges with defaults rather than overwriting #4131
* feat: allow setting `default` on `_id` #4069
* BREAKING CHANGE: `deleteX()` and `remove()` promise resolves to the write object result #4013
* feat: support returning a promise from middleware functions #3779
* BREAKING CHANGE: don't return a promise if callback specified #3670
* BREAKING CHANGE: only cast `update()`, `updateX()`, `replaceOne()`, `remove()`, `deleteX()` in exec #3529
* BREAKING CHANGE: sync errors in middleware functions are now handled #3483
* BREAKING CHANGE: post hooks get flow control #3232
* BREAKING CHANGE: deduplicate hooks when merging discriminator schema #2945
* BREAKING CHANGE: use native promises by default, remove support for mpromise #2917
* BREAKING CHANGE: remove `retainKeyOrder`, always use forward order when iterating through objects #2749
* BREAKING CHANGE: `aggregate()` no longer accepts a spread #2716
4.13.8 / 2017-12-27
===================
* docs(guide): use more up-to-date syntax for autoIndex example #5933
* docs: fix grammar #5927 [abagh0703](https://github.com/abagh0703)
* fix: propagate lean options to child schemas #5914
* fix(populate): use correct model with discriminators + nested populate #5858
4.13.7 / 2017-12-11
===================
* docs(schematypes): fix typo #5889 [gokaygurcan](https://github.com/gokaygurcan)
* fix(cursor): handle `reject(null)` with eachAsync callback #5875 #5874 [ZacharyRSmith](https://github.com/ZacharyRSmith)
* fix: disallow setting `mongoose.connection` to invalid values #5871 [jinasonlin](https://github.com/jinasonlin)
* docs(middleware): suggest using `return next()` to stop middleware execution #5866
* docs(connection): improve connection string query param docs #5864
* fix(document): run validate hooks on array subdocs even if not directly modified #5861
* fix(discriminator): don't treat $meta as defining projection when querying #5859
* fix(types): handle Decimal128 when using bson-ext on server side #5850
* fix(document): ensure projection with only $slice isn't treated as inclusive for discriminators #4991
* fix(model): throw error when passing non-object to create() #2037
4.13.6 / 2017-12-02
===================
* fix(schema): support strictBool option in schema #5856 [ekulabuhov](https://github.com/ekulabuhov)
* fix(update): make upsert option consistently handle truthy values, not just booleans, for updateOne() #5839
* refactor: remove unnecessary constructor check #2057
* docs(query): correct function signature for .mod() helper #1806
* fix(query): report ObjectParameterError when passing non-object as filter to find() and findOne() #1698
4.13.5 / 2017-11-24
===================
* fix(model): handle update cast errors correctly with bulkWrite #5845 [Michael77](https://github.com/Michael77)
* docs: add link to bufferCommands option #5844 [ralphite](https://github.com/ralphite)
* fix(model): allow virtual ref function to return arrays #5834 [brunohcastro](https://github.com/brunohcastro)
* fix(query): don't throw uncaught error if query filter too big #5812
* fix(document): if setting unselected nested path, don't overwrite nested path #5800
* fix(document): support calling `populate()` on nested document props #5703
* fix: add `strictBool` option for schema type boolean #5344 #5211 #4245
* docs(faq): add faq re: typeKey #1886
* docs(query): add more detailed docs re: options #1702
4.13.4 / 2017-11-17
===================
* fix(aggregate): add chainable .option() helper for setting arbitrary options #5829
* fix(aggregate): add `.pipeline()` helper to get the current pipeline #5825
* docs: grammar fixes for `unique` FAQ #5823 [mfluehr](https://github.com/mfluehr)
* chore: add node 9 to travis #5822 [superheri](https://github.com/superheri)
* fix(model): fix infinite recursion with recursive embedded discriminators #5821 [Faibk](https://github.com/Faibk)
4.13.3 / 2017-11-15
===================
* chore: add node 8 to travis #5818 [superheri](https://github.com/superheri)
* fix(document): don't apply transforms to nested docs when updating already saved doc #5807
4.13.2 / 2017-11-11
===================
* feat(buffer): add support for subtype prop #5530
4.13.1 / 2017-11-08
===================
* fix: accept multiple paths or array of paths to depopulate #5798 #5797 [adamreisnz](https://github.com/adamreisnz)
* fix(document): pass default array as actual array rather than taking first element #5780
* fix(model): increment version when $set-ing it in a save() that requires a version bump #5779
* fix(query): don't explicitly project in discriminator key if user projected in parent path #5775 #5754
* fix(model): cast query option to geoNear() #5765
* fix(query): don't treat projection with just $slice as inclusive #5737
* fix(discriminator): defer applying embedded discriminator hooks until top-level model is compiled #5706
* docs(discriminator): add warning to always attach hooks before calling discriminator() #5706
4.13.0 / 2017-11-02
===================
* feat(aggregate): add $addFields helper #5740 [AyushG3112](https://github.com/AyushG3112)
* feat(connection): add connection-level bufferCommands #5720
* feat(connection): add createCollection() helper #5712
* feat(populate): support setting localField and foreignField to functions #5704 #5602
* feat(query): add multipleCastError option for aggregating cast errors when casting update #5609
* feat(populate): allow passing a function to virtual ref #5602
* feat(schema): add excludeIndexes option to optionally prevent collecting indexes from nested schemas #5575
* feat(model): report validation errors from `insertMany()` if using `ordered: false` and `rawResult: true` #5337
* feat(aggregate): add pre/post aggregate middleware #5251
* feat(schema): allow using `set` as a schema path #1939
4.12.6 / 2017-11-01
===================
* fix(schema): make clone() copy query helpers correctly #5752
* fix: undeprecate `ensureIndex()` and use it by default #3280
4.12.5 / 2017-10-29
===================
* fix(query): correctly handle `$in` and required for $pull and update validators #5744
* feat(aggegate): add $addFields pipeline operator #5740 [AyushG3112](https://github.com/AyushG3112)
* fix(document): catch sync errors in document pre hooks and report as error #5738
* fix(populate): handle slice projections correctly when automatically selecting populated fields #5737
* fix(discriminator): fix hooks for embedded discriminators #5706 [wlingke](https://github.com/wlingke)
* fix(model): throw sane error when customer calls `mongoose.Model()` over `mongoose.model()` #2005
4.12.4 / 2017-10-21
===================
* test(plugins): add coverage for idGetter with id as a schema property #5713 [wlingke](https://github.com/wlingke)
* fix(model): avoid copying recursive $$context object when creating discriminator after querying #5721
* fix(connection): ensure connection promise helpers are removed before emitting 'connected' #5714
* docs(schema): add notes about runSettersOnQuery to schema setters #5705
* fix(collection): ensure queued operations run on the next tick #5562
4.12.3 / 2017-10-16
===================
* fix(connection): emit 'reconnect' event as well as 'reconnected' for consistency with driver #5719
* fix: correctly bubble up left/joined events for replica set #5718
* fix(connection): allow passing in `autoIndex` as top-level option rather than requiring `config.autoIndex` #5711
* docs(connection): improve docs regarding reconnectTries, autoReconnect, and bufferMaxEntries #5711
* fix(query): handle null with addToSet/push/pull/pullAll update validators #5710
* fix(model): handle setDefaultsOnInsert option for bulkWrite updateOne and updateMany #5708
* fix(query): avoid infinite recursion edge case when cloning a buffer #5702
4.12.2 / 2017-10-14
===================
* docs(faq): add FAQ about using arrow functions for getters/setters, virtuals, and methods #5700
* docs(schema): document the childSchemas property and add to public API #5695
* fix(query): don't project in populated field if parent field is already projected in #5669
* fix: bump mongodb -> 2.2.33 for issue with autoReconnect #4513
4.12.1 / 2017-10-08
===================
* fix(document): create new doc when setting single nested, no more set() on copy of priorVal #5693
* fix(model): recursively call applyMethods on child schemas for global plugins #5690
* docs: fix bad promise lib example on home page #5686
* fix(query): handle false when checking for inclusive/exclusive projection #5685
* fix(discriminator): allow reusing child schema #5684
* fix: make addToSet() on empty array with subdoc trigger manual population #5504
4.12.0 / 2017-10-02
===================
* docs(validation): add docs coverage for ValidatorError.reason #5681
* feat(discriminator): always add discriminatorKey to base schema to allow updating #5613
* fix(document): make nested docs no longer inherit parent doc's schema props #5586 #5546 #5470
* feat(query): run update validators on $pull and $pullAll #5555
* feat(query): add .error() helper to query to error out in pre hooks #5520
* feat(connection): add dropCollection() helper #5393
* feat(schema): add schema-level collation option #5295
* feat(types): add `discriminator()` function for single nested subdocs #5244
* feat(document): add $isDeleted() getter/setter for better support for soft deletes #4428
* feat(connection): bubble up reconnectFailed event when driver gives up reconnecting #4027
* fix(query): report error if passing array or other non-object as filter to update query #3677
* fix(collection): use createIndex() instead of deprecated ensureIndex() #3280
4.11.14 / 2017-09-30
====================
* chore: add nsp check to the CI build #5679 [hairyhenderson](https://github.com/hairyhenderson)
* fix: bump mquery because of security issue with debug package #5677 #5675 [jonathanprl](https://github.com/jonathanprl)
* fix(populate): automatically select() populated()-ed fields #5669
* fix(connection): make force close work as expected #5664
* fix(document): treat $elemMatch as inclusive projection #5661
* docs(model/query): clarify which functions fire which middleware #5654
* fix(model): make `init()` public and return a promise that resolves when indexes are done building #5563
4.11.13 / 2017-09-24
====================
* fix(query): correctly run replaceOne with update validators #5665 [sime1](https://github.com/sime1)
* fix(schema): replace mistype in setupTimestamp method #5656 [zipp3r](https://github.com/zipp3r)
* fix(query): avoid throwing cast error for strict: throw with nested id in query #5640
* fix(model): ensure class gets combined schema when using class syntax with discriminators #5635
* fix(document): handle setting doc array to array of top-level docs #5632
* fix(model): handle casting findOneAndUpdate() with overwrite and upsert #5631
* fix(update): correctly handle $ in updates #5628
* fix(types): handle manual population consistently for unshift() and splice() #5504
4.11.12 / 2017-09-18
====================
* docs(model): asterisk should not render as markdown bullet #5644 [timkinnane](https://github.com/timkinnane)
* docs: use useMongoClient in connection example #5627 [GabrielNicolasAvellaneda](https://github.com/GabrielNicolasAvellaneda)
* fix(connection): call callback when initial connection failed #5626
* fix(query): apply select correctly if a given nested schema is used for 2 different paths #5603
* fix(document): add graceful fallback for setting a doc array value and `pull()`-ing a doc #3511
4.11.11 / 2017-09-10
====================
* fix(connection): properly set readyState in response to driver 'close' and 'reconnect' events #5604
* fix(document): ensure single embedded doc setters only get called once, with correct value #5601
* fix(timestamps): allow enabling updatedAt without createdAt #5598
* test: improve unique validator test by making create run before ensureIndex #5595 #5562
* fix(query): ensure find callback only gets called once when post init hook throws error #5592
4.11.10 / 2017-09-03
====================
* docs: add KeenIO tracking #5612
* fix(schema): ensure validators declared with `.validate()` get copied with clone() #5607
* fix: remove unnecessary jest warning #5480
* fix(discriminator): prevent implicit discriminator schema id from clobbering base schema custom id #5591
* fix(schema): hide schema objectid warning for non-hex strings of length 24 #5587
* docs(populate): use story schema defined key author instead of creator #5578 [dmric](https://github.com/dmric)
* docs(document): describe usage of `.set()` #5576
* fix(document): ensure correct scope in single nested validators #5569
* fix(populate): don't mark path as populated until populate() is done #5564
* fix(document): make push()-ing a doc onto an empty array act as manual population #5504
* fix(connection): emit timeout event on socket timeout #4513
4.11.9 / 2017-08-27
===================
* fix(error): avoid using arguments.callee because that breaks strict mode #5572
* docs(schematypes): fix spacing #5567
* fix(query): enforce binary subtype always propagates to mongodb #5551
* fix(query): only skip castForQuery for mongoose arrays #5536
* fix(browser): rely on browser entrypoint to decide whether to use BrowserDocument or NodeDocument #5480
4.11.8 / 2017-08-23
===================
* feat: add warning about using schema ObjectId as type ObjectId #5571 [efkan](https://github.com/efkan)
* fix(schema): allow setting `id` property after schema was created #5570 #5548
* docs(populate): remove confusing _ from populate docs #5560
* fix(connection): expose parsed uri fields (host, port, dbname) when using openUri() #5556
* docs: added type boolean to options documentation #5547 [ndabAP](https://github.com/ndabAP)
* test: add test coverage for stopping/starting server #5524
* fix(aggregate): pull read preference from schema by default #5522
4.11.7 / 2017-08-14
===================
* fix: correct properties when calling toJSON() on populated virtual #5544 #5442 [davidwu226](https://github.com/davidwu226)
* docs: fix spelling #5535 [et](https://github.com/et)
* fix(error): always set name before stack #5533
* fix: add warning about running jest in jsdom environment #5532 #5513 #4943
* fix(document): ensure overwriting a doc array cleans out individual docs #5523
* fix(schema): handle creating arrays of single nested using type key #5521
* fix: upgrade mongodb -> 2.2.31 to support user/pass options #5419
4.11.6 / 2017-08-07
===================
* fix: limiting number of async operations per time in insertMany #5529 [andresattler](https://github.com/andresattler)
* fix: upgrade mongodb -> 2.2.30 #5517
* fix(browserDocument): prevent stack overflow caused by double-wrapping embedded doc save() in jest #5513
* fix(document): clear single nested doc when setting to empty object #5506
* fix(connection): emit reconnected and disconnected events correctly with useMongoClient #5498
* fix(populate): ensure nested virtual populate gets set even if top-level property is null #5431
4.11.5 / 2017-07-30
===================
* docs: fix link to $lookup #5516 [TalhaAwan](https://github.com/TalhaAwan)
* fix: better parallelization for eachAsync #5502 [lchenay](https://github.com/lchenay)
* docs(document): copy docs for save from model to doc #5493
* fix(document): handle dotted virtuals in toJSON output #5473
* fix(populate): restore user-provided limit after mutating so cursor() works with populate limit #5468
* fix(query): don't throw StrictModeError if geo query with upsert #5467
* fix(populate): propagate readPreference from query to populate queries by default #5460
* docs: warn not to use arrow functions for statics and methods #5458
* fix(query): iterate over all condition keys for setDefaultsOnInsert #5455
* docs(connection): clarify server/replset/mongos option deprecation with useMongoClient #5442
4.11.4 / 2017-07-23
===================
* fix: handle next() errors in `eachAsync()` #5486 [lchenay](https://github.com/lchenay)
* fix(schema): propagate runSettersOnQuery option to implicitly created schemas #5479 [https://github.com/ValYouW]
* fix(query): run castConditions() correctly in update ops #5477
* fix(query): ensure castConditions called for findOne and findOneAnd* #5477
* docs: clarify relationship between $lookup and populate #5475 [TalhaAwan](https://github.com/TalhaAwan)
* test: add coverage for arrays of arrays [zbjornson](https://github.com/zbjornson)
* fix(middleware): ensure that error handlers for save get doc as 2nd param #5466
* fix: handle strict: false correctly #5454 #5453 [wookieb](https://github.com/wookieb)
* fix(query): apply schema excluded paths if only projection is a $slice #5450
* fix(query): correct discriminator handling for schema `select: false` fields in schema #5448
* fix(cursor): call next() in series when parallel option used #5446
* chore: load bundled driver first to avoid packaging problem #5443 [prototypeme](https://github.com/prototypeme)
* fix(query): defer condition casting until final exec #5434
* fix(aggregate): don't rely on mongodb aggregate to put a cursor in the callback #5394
* docs(aggregate): add useMongooseAggCursor docs #5394
* docs(middleware): clarify context for document, query, and model middleware #5381
4.11.3 / 2017-07-14
===================
* fix(connection): remove .then() before resolving to prevent infinite recursion #5471
4.11.2 / 2017-07-13
===================
* docs: fix comment typo in connect example #5435 [ConnorMcF](https://github.com/ConnorMcF)
* fix(update): correctly cast document array in update validators with exec() #5430
* fix(connection): handle autoIndex with useMongoClient #5423
* fix(schema): handle `type: [Array]` in schemas #5416
* fix(timestamps): if overwrite is set and there's a $set, use $set instead of top-level update #5413
* fix(document): don't double-validate deeply nested doc array elements #5411
* fix(schematype): clone default objects so default not shared across object instances unless `shared` specified #5407
* fix(document): reset down the nested subdocs when resetting parent doc #5406
* fix: don't pass error arg twice to error handlers #5405
* fix(connection): make openUri() return connection decorated with then() and catch() #5404
* fix: enforce $set on an array must be an array #5403
* fix(document): don't crash if calling `validateSync()` after overwriting doc array index #5389
* fix(discriminator): ensure discriminator key doesn't count as user-selected field for projection #4629
4.11.1 / 2017-07-02
===================
* docs: populate virtuals fix justOne description #5427 [fredericosilva](https://github.com/fredericosilva)
* fix(connection): make sure to call onOpen in openUri() #5404
* docs(query): justOne is actually single, and it default to false #5402 [zbjornson](https://github.com/zbjornson)
* docs: fix small typo in lib/schema.js #5398 #5396 [pjo336](https://github.com/pjo336)
* fix: emit remove on single nested subdocs when removing parent #5388
* fix(update): handle update with defaults and overwrite but no update validators #5384
* fix(populate): handle undefined refPath values in middle of array #5377
* fix(document): ensure consistent setter context for single nested #5363
* fix(query): support runSettersOnQuery as query option #5350
4.11.0 / 2017-06-25
===================
* feat(query): execute setters with query as context for `runSettersOnQuery` #5339
* feat(model): add translateAliases function #5338 [rocketspacer](https://github.com/rocketspacer)
* feat(connection): add `useMongoClient` and `openUri` functions, deprecate current connect logic #5304
* refactor(schema): make id virtual not access doc internals #5279
* refactor: handle non-boolean lean #5279
* feat(cursor): add addCursorFlag() support to query and agg cursors #4814
* feat(cursor): add parallel option to eachAsync #4244
* feat(schema): allow setting custom error constructor for custom validators #4009
4.10.8 / 2017-06-21
===================
* docs: fix small formatting typo on schematypes #5374 [gianpaj](https://github.com/gianpaj)
* fix(model): allow null as an _id #5370
* fix(populate): don't throw async uncaught exception if model not found in populate #5364
* fix: correctly cast decimals in update #5361
* fix(error): don't use custom getter for ValidationError message #5359
* fix(query): handle runSettersOnQuery in built-in _id setter #5351
* fix(document): ensure consistent context for nested doc custom validators #5347
4.10.7 / 2017-06-18
===================
* docs(validation): show overriding custom validator error with 2nd cb arg #5358
* fix: `parseOption` mutates user passed option map #5357 [igwejk](https://github.com/igwejk)
* docs: fix guide.jade typo #5356 [CalebAnderson2014](https://github.com/CalebAnderson2014)
* fix(populate): don't set populate virtual to ids when match fails #5336
* fix(query): callback with cast error if remove and delete* args have a cast error #5323
4.10.6 / 2017-06-12
===================
* fix(cursor): handle custom model option for populate #5334
* fix(populate): handle empty virtual populate with Model.populate #5331
* fix(model): make ensureIndexes() run with autoIndex: false unless called internally #5328 #5324 #5317
* fix: wait for all connections to close before resolving disconnect() promise #5316
* fix(document): handle setting populated path with custom typeKey in schema #5313
* fix(error): add toJSON helper to ValidationError so `message` shows up with JSON.stringify #5309
* feat: add `getPromiseConstructor()` to prevent need for `mongoose.Promise.ES6` #5305
* fix(document): handle conditional required with undefined props #5296
* fix(model): clone options before inserting in save() #5294
* docs(populate): clarify that multiple populate() calls on same path overwrite #5274
4.10.5 / 2017-06-06
===================
* chore: improve contrib guide for building docs #5312
* fix(populate): handle init-ing nested virtuals properly #5311
* fix(update): report update validator error if required path under single nested doc not set
* fix(schema): remove default validate pre hook that was causing issues with jest #4943
4.10.4 / 2017-05-29
===================
* chore: dont store test data in same directory #5303
* chore: add data dirs to npmignore #5301 [Starfox64](https://github.com/Starfox64)
* docs(query): add docs about runSettersOnQuery #5300
4.10.3 / 2017-05-27
===================
* docs: correct inconsistent references to updateOne and replaceOne #5297 [dhritzkiv](https://github.com/dhritzkiv)
* docs: fix dropdowns in docs #5292 [nathanallen](https://github.com/nathanallen)
* docs: add description of alias option #5287
* fix(document): prevent infinite loop if validating nested array #5282
* fix(schema): correctly handle ref ObjectIds from different mongoose libs #5259
* fix(schema): load child class methods after base class methods to allow override #5227
4.10.2 / 2017-05-22
===================
* fix: bump ms -> 2.0.0 and mquery -> 2.3.1 for minor security vulnerability #5275
4.10.1 / 2017-05-21
===================
* fix(aggregate): handle sorting by text score correctly #5258
* fix(populate): handle doc.populate() with virtuals #5240
* fix(schema): enforce that `_id` is never null #5236
4.10.0 / 2017-05-18
===================
* fix(schema): update clone method to include indexes #5268 [clozanosanchez](https://github.com/clozanosanchez)
* feat(schema): support aliases #5184 [rocketspacer](https://github.com/rocketspacer)
* feat(aggregate): add mongoose-specific aggregation cursor option #5145
* refactor(model): make sharding into a plugin instead of core #5105
* fix(document): make nested doc mongoose internals not enumerable again #5078
* feat(model): pass params to pre hooks #5064
* feat(timestamps): support already defined timestamp paths in schema #4868
* feat(query): add runSettersOnQuery option #4569
* fix(query): add strictQuery option that throws when not querying on field not in schema #4136
* fix(update): more complete handling for overwrite option with update validators #3556
* feat: support `unique: true` in arrays via the mongoose-unique-array plugin #3347
* fix(model): always emit 'index', even if no indexes #3347
* fix(schema): set unique indexes on primitive arrays #3347
* feat(validation): include failed paths in error message and inspect output #3064 #2135
* fix(model): return saved docs when create() fails #2190
4.9.10 / 2017-05-17
===================
* fix(connection): ensure callback arg to openSet() is handled properly #5249
* docs: remove dead plugins repo and add content links #5247
* fix(model): skip index build if connecting after model init and autoIndex false #5176
4.9.9 / 2017-05-13
==================
* docs: correct value for Query#regex() #5230
* fix(connection): don't throw if .catch() on open() promise #5229
* fix(schema): allow update with $currentDate for updatedAt to succeed #5222
* fix(model): versioning doesn't fail if version key undefined #5221 [basileos](https://github.com/basileos)
* fix(document): don't emit model error if callback specified for consistency with docs #5216
* fix(document): handle errors in subdoc pre validate #5215
4.9.8 / 2017-05-07
==================
* docs(subdocs): rewrite subdocs guide #5217
* fix(document): avoid circular JSON if error in doc array under single nested subdoc #5208
* fix(document): set intermediate empty objects for deeply nested undefined paths before path itself #5206
* fix(schema): throw error if first param to schema.plugin() is not a function #5201
* perf(document): major speedup in validating subdocs (50x in some cases) #5191
4.9.7 / 2017-04-30
==================
* docs: fix typo #5204 [phutchins](https://github.com/phutchins)
* fix(schema): ensure correct path for deeply nested schema indexes #5199
* fix(schema): make remove a reserved name #5197
* fix(model): handle Decimal type in insertMany correctly #5190
* fix: upgrade kareem to handle async pre hooks correctly #5188
* docs: add details about unique not being a validator #5179
* fix(validation): handle returning a promise with isAsync: true #5171
4.9.6 / 2017-04-23
==================
* fix: update `parentArray` references when directly assigning document arrays #5192 [jhob](https://github.com/jhob)
* docs: improve schematype validator docs #5178 [milesbarr](https://github.com/milesbarr)
* fix(model): modify discriminator() class in place #5175
* fix(model): handle bulkWrite updateMany casting #5172 [tzellman](https://github.com/tzellman)
* docs(model): fix replaceOne example for bulkWrite #5168
* fix(document): don't create a new array subdoc when creating schema array #5162
* fix(model): merge query hooks from discriminators #5147
* fix(document): add parent() function to subdocument to match array subdoc #5134
4.9.5 / 2017-04-16
==================
* fix(query): correct $pullAll casting of null #5164 [Sebmaster](https://github.com/Sebmaster)
* docs: add advanced schemas docs for loadClass #5157
* fix(document): handle null/undefined gracefully in applyGetters() #5143
* fix(model): add resolveToObject option for mapReduce with ES6 promises #4945
4.9.4 / 2017-04-09
==================
* fix(schema): clone query middleware correctly #5153 #5141 [clozanosanchez](https://github.com/clozanosanchez)
* docs(aggregate): fix typo #5142
* fix(query): cast .$ update to underlying array type #5130
* fix(populate): don't mutate populate result in place #5128
* fix(query): handle $setOnInsert consistent with $set #5126
* docs(query): add strict mode option for findOneAndUpdate #5108
4.9.3 / 2017-04-02
==================
* docs: document.js fixes for functions prepended with `$` #5131 [krmannix](https://github.com/krmannix)
* fix: Avoid exception on constructor check #5129 [monkbroc](https://github.com/monkbroc)
* docs(schematype): explain how to use `isAsync` with validate() #5125
* docs(schematype): explain custom message with required function #5123
* fix(populate): only apply refPath duplicate id optimization if not array #5114
* fix(document): copy non-objects to doc when init() #5111
* perf(populate): dont clone whole options every time #5103
* feat(document): add isDirectSelected() to minimize isSelected() changes #5063
* docs(schematypes): explain some subtleties with arrays #5059
4.9.2 / 2017-03-26
==================
* fix(discriminator): handle class names consistently #5104
* fix(schema): make clone() work with reusing discriminator schemas #5098
* fix(querycursor): run pre find hooks with .cursor() #5096
* fix(connection): throw error if username:password includes @ or : #5091
* fix(timestamps): handle overwriting createdAt+updatedAt consistently #5088
* fix(document): ensure subdoc post save runs after parent save #5085
* docs(model): improve update docs #5076 [bertolo1988](https://github.com/bertolo1988)
4.9.1 / 2017-03-19
==================
* fix(query): handle $type for arrays #5080 #5079 [zoellner](https://github.com/zoellner)
* fix(model): handle ordered param for `insertMany` validation errors #5072 [sjorssnoeren](https://github.com/sjorssnoeren)
* fix(populate): avoid duplicate ids in dynref queries #5054
* fix(timestamps): dont set timestamps in update if user set it #5045
* fix(update): dont double-call setters on arrays #5041
* fix: upgrade driver -> 2.2.25 for jest fix #5033
* fix(model): get promise each time save() is called rather than once #5030
* fix(connection): make connect return value consistent #5006
4.9.0 / 2017-03-13
==================
* feat(document): return this from `depopulate()` #5027
* fix(drivers): stop emitting timeouts as errors #5026
* feat(schema): add a clone() function for schemas #4983
* feat(query): add rawResult option to replace passRawResult, deprecate passRawResult #4977 #4925
* feat(schematype): support isAsync validator option and handle returning promises from validators, deprecate implicit async validators #4290
* feat(query): add `replaceOne()`, `deleteOne()`, `deleteMany()` #3998
* feat(model): add `bulkWrite()` #3998
4.8.7 / 2017-03-12
==================
* fix(model): if last arg in spread is falsy, treat it as a callback #5061
* fix(document): use $hook instead of hook to enable 'hook' as a path name #5047
* fix(populate): dont select foreign field if parent field is selected #5037
* fix(populate): handle passing no args to query.populate #5036
* fix(update): use correct method for casting nested arrays #5032
* fix(discriminator): handle array discriminators when casting $push #5009
4.8.6 / 2017-03-05
==================
* docs(document): remove text that implies that transform is false by default #5023
* fix(applyHooks): dont wrap a function if it is already wrapped #5019
* fix(document): ensure nested docs' toObject() clones #5008
4.8.5 / 2017-02-25
==================
* fix: check for empty schemaPath before accessing property $isMongooseDocumentArray #5017 [https://github.com/randyhoulahan](randyhoulahan)
* fix(discriminators): handle create() and push() for embedded discriminators #5001
* fix(querycursor): ensure close emitted after last data event #4998
* fix(discriminators): remove fields not selected in child when querying by base model #4991
4.8.4 / 2017-02-19
==================
* docs(discriminators): explain embedded discriminators #4997
* fix(query): fix TypeError when findOneAndUpdate errors #4990
* fix(update): handle nested single embedded in update validators correctly #4989
* fix(browser): make browser doc constructor not crash #4987
4.8.3 / 2017-02-15
==================
* chore: upgrade mongodb driver -> 2.2.24
* docs(connections): addd some details about callbacks #4986
* fix: ensure class is created with new keyword #4972 #4947 [benhjames](https://github.com/benhjames)
* fix(discriminator): add applyPluginsToDiscriminators option #4965
* fix(update): properly cast array subdocs when casting update #4960
* fix(populate): ensure foreign field is selected for virtual populate #4959
* docs(query): document some query callback params #4949
* fix(document): ensure errors in validators get caught #2185
4.8.2 / 2017-02-10
==================
* fix(update): actually run validators on addToSet #4953
* fix(update): improve buffer error handling #4944 [ValYouW](https://github.com/ValYouW)
* fix(discriminator): handle subclassing with loadClass correctly #4942
* fix(query): allow passing Map to sort() #4941
* fix(document): handle setting discriminator doc #4935
* fix(schema): return correct value from pre init hook #4928
* fix(query): ensure consistent params in error handlers if pre hook errors #4927
4.8.1 / 2017-01-30
==================
* fix(query): handle $exists for arrays and embedded docs #4937
* fix(query): handle passing string to hint() #4931
4.8.0 / 2017-01-28
==================
* feat(schema): add saveErrorIfNotFound option and $where property #4924 #4004
* feat(query): add $in implicitly if passed an array #4912 [QuotableWater7](https://github.com/QuotableWater7)
* feat(aggregate): helper for $facet #4904 [varunjayaraman](https://github.com/varunjayaraman)
* feat(query): add collation method #4839
* feat(schema): propogate strict option to implicit array subschemas #4831 [dkrosso](https://github.com/dkrosso)
* feat(aggregate): add helper for graphLookup #4819 [varunjayaraman](https://github.com/varunjayaraman)
* feat(types): support Decimal128 #4759
* feat(aggregate): add eachAsync() to aggregate cursor #4300
* feat(query): add updateOne and updateMany #3997
* feat(model): support options for insertMany #3893
* fix(document): run validation on single nested docs if not directly modified #3884
* feat(model): use discriminator constructor based on discriminatorKey in create() #3624
* feat: pass collection as context to debug function #3261
* feat(query): support push and addToSet for update validators #2933
* perf(document): refactor registerHooksFromSchema so hooks are defined on doc prototype #2754
* feat(types): add discriminator() function to doc arrays #2723 #1856
* fix(populate): return an error if sorting underneath a doc array #2202
4.7.9 / 2017-01-27
==================
* fix(query): handle casting $exists under $not #4933
* chore: upgrade mongodb -> 2.2.22 re: #4931
4.7.8 / 2017-01-23
==================
* fix(populate): better handling for virtual populate under arrays #4923
* docs: upgrade contributors count #4918 [AdamZaczek](https://github.com/AdamZaczek)
* fix(query): don't set nested path default if setting parent path #4911
* docs(promise): add missing bracket #4907
* fix(connection): ensure error handling is consistently async #4905
* fix: handle authMechanism in query string #4900
* fix(document): ensure error handlers run for validate #4885
4.7.7 / 2017-01-15
==================
* fix(utils): don't crash if to[key] is null #4881
* fix: upgrade mongodb -> 2.2.21 #4867
* fix: add a toBSON to documents for easier querying #4866
* fix: suppress bluebird warning #4854 [davidwu226](https://github.com/davidwu226)
* fix(populate): handle nested virtuals in virtual populate #4851
4.7.6 / 2017-01-02
==================
* fix(model): allow passing non-array to insertMany #4846
* fix(populate): use base model name if no discriminator for backwards compat #4843
* fix: allow internal validate callback to be optional #4842 [arciisine](https://github.com/arciisine)
* fix(document): don't skip pointCut if save not defined (like in browser doc) #4841
* chore: improve benchmarks #4838 [billouboq](https://github.com/billouboq)
* perf: remove some unused parameters #4837 [billouboq](https://github.com/billouboq)
* fix(query): don't call error handler if passRawResult is true and no error occurred #4836
4.7.5 / 2016-12-26
==================
* docs(model): fix spelling mistake #4828 [paulinoj](https://github.com/paulinoj)
* fix(aggregate): remove unhandled rejection when using aggregate.then() #4824
* perf: remove try/catch that kills optimizer #4821
* fix(model): handles populating with discriminators that may not have a ref #4817
* fix(document): handle setting array of discriminators #3575
4.7.4 / 2016-12-21
==================
* docs: fix typo #4810 [GEEKIAM](https://github.com/GEEKIAM)
* fix(query): timestamps with $push + $each #4805
* fix(document): handle buffers correctly in minimize #4800
* fix: don't disallow overwriting default and cast fns #4795 [pdspicer](https://github.com/pdspicer)
* fix(document): don't convert single nested docs to POJOs #4793
* fix(connection): handle reconnect to replica set correctly #4972 [gfzabarino](https://github.com/gfzabarino)
4.7.3 / 2016-12-16
==================
* fix: upgrade mongodb driver -> 2.2.16 for several bug fixes and 3.4 support #4799
* fix(model): ensure discriminator key is correct for child schema on discriminator #4790
* fix(document): handle mark valid in subdocs correctly #4778
* fix(query): check for objects consistently #4775
4.7.2 / 2016-12-07
==================
* test(populate): fix justOne test #4772 [cblanc](https://github.com/cblanc)
* chore: fix benchmarks #4769 [billouboq](https://github.com/billouboq)
* fix(document): handle setting subdoc to null after setting parent doc #4766
* fix(query): support passRawResult with lean #4762 #4761 [mhfrantz](https://github.com/mhfrantz)
* fix(query): throw StrictModeError if upsert with nonexisting field in condition #4757
* test: fix a couple of sort tests #4756 [japod](https://github.com/japod)
* chore: upgrade mongodb driver -> 2.2.12 #4753 [mdlavin](https://github.com/mdlavin)
* fix(query): handle update with upsert and overwrite correctly #4749
4.7.1 / 2016-11-30
==================
* fix(schema): throw error if you use prototype as a schema path #4746
* fix(schema): throw helpful error if you define a virtual with the same path as a real path #4744
* fix(connection): make createConnection not throw rejected promises #4742
* fix(populate): allow specifiying options in model schema #4741
* fix(document): handle selected nested elements with defaults #4739
* fix(query): add model to cast error if possible #4729
* fix(query): handle timestamps with overwrite #4054
4.7.0 / 2016-11-23
==================
* docs: clean up schematypes #4732 [kidlj](https://github.com/kidlj)
* perf: only get stack when necessary with VersionError #4726 [Sebmaster](https://github.com/Sebmaster)
* fix(query): ensure correct casting when setting array element #4724
* fix(connection): ensure db name gets set when you pass 4 params #4721
* fix: prevent TypeError in node v7 #4719 #4706
* feat(document): support .set() on virtual subpaths #4716
* feat(populate): support populate virtuals on nested schemas #4715
* feat(querycursor): support transform option and .map() #4714 #4705 [cblanc](https://github.com/cblanc)
* fix(document): dont set defaults on not-selected nested paths #4707
* fix(populate): don't throw if empty string passed to populate #4702
* feat(model): add `loadClass()` function for importing schema from ES6 class #4668 [rockmacaca](https://github.com/rockmacaca)
4.6.8 / 2016-11-14
==================
* fix(querycursor): clear stack when iterating onto next doc #4697
* fix: handle null keys in validation error #4693 #4689 [arciisine](https://github.com/arciisine)
* fix(populate): handle pre init middleware correctly with populate virtuals #4683
* fix(connection): ensure consistent return value for open and openSet #4659
* fix(schema): handle falsy defaults for arrays #4620
4.6.7 / 2016-11-10
==================
* fix(document): only invalidate in subdoc if using update validators #4681
* fix(document): don't create subdocs when excluded in projection #4669
* fix(document): ensure single embedded schema validator runs with correct context #4663
* fix(document): make sure to depopulate top level for sharding #4658
* fix(connection): throw more helpful error when .model() called incorrectly #4652
* fix(populate): throw more descriptive error when trying to populate a virtual that doesn't have proper options #4602
* fix(document): ensure subtype gets set properly when saving with a buffer id #4506
* fix(query): handle setDefaultsOnInsert with defaults on doc arrays #4456
* fix(drivers): make debug output better by calling toBSON() #4356
4.6.6 / 2016-11-03
==================
* chore: upgrade deps #4674 [TrejGun](https://github.com/TrejGun)
* chore: run tests on node v7 #4673 [TrejGun](https://github.com/TrejGun)
* perf: make setDefaultsOnInsert more efficient if upsert is off #4672 [CamHenlin](https://github.com/CamHenlin)
* fix(populate): ensure document array is returned #4656
* fix(query): cast doc arrays with positionals correctly for update #4655
* fix(document): ensure single nested doc validators run with correct context #4654
* fix: handle reconnect failed error in new version of driver #4653 [loris](https://github.com/loris)
* fix(populate): if setting a populated doc, take its id #4632
* fix(populate): handle populated virtuals in init #4618
4.6.5 / 2016-10-23
==================
* docs: fix grammar issues #4642 #4640 #4639 [silvermanj7](https://github.com/silvermanj7)
* fix(populate): filter out nonexistant values for dynref #4637
* fix(query): handle $type as a schematype operator #4632
* fix(schema): better handling for uppercase: false and lowercase: false #4622
* fix(query): don't run transforms on updateForExec() #4621
* fix(query): handle id = 0 in findById #4610
* fix(query): handle buffers in mergeClone #4609
* fix(document): handle undefined with conditional validator for validateSync #4607
* fix: upgrade to mongodb driver 2.2.11 #4581
* docs(schematypes): clarify schema.path() #4518
* fix(query): ensure path is defined before checking in timestamps #4514
* fix(model): set version key in upsert #4505
* fix(document): never depopulate top-level doc #3057
* refactor: ensure sync for setting non-capped collections #2690
4.6.4 / 2016-10-16
==================
* fix(query): cast $not correctly #4616 #4592 [prssn](https://github.com/prssn)
* fix: address issue with caching global plugins #4608 #4601 [TrejGun](https://github.com/TrejGun)
* fix(model): make sure to depopulate in insertMany #4590
* fix(model): buffer autoIndex if bufferCommands disabled #4589
* fix(populate): copy ids array before modifying #4585
* feat(schema): add retainKeyOrder prop #4542
* fix(document): return isModified true for children of direct modified paths #4528
* fix(connection): add dropDatabase() helper #4490
* fix(model): add usePushEach option for schemas #4455
* docs(connections): add some warnings about buffering #4413
* fix: add ability to set promise implementation in browser #4395
4.6.3 / 2016-10-05
==================
* fix(document): ensure single nested docs get initialized correctly when setting nested paths #4578
* fix: turn off transforms when writing nested docs to db #4574
* fix(document): don't set single nested subdocs to null when removing parent doc #4566
* fix(model): ensure versionKey gets set in insertMany #4561
* fix(schema): handle typeKey in arrays #4548
* feat(schema): set $implicitlyCreated on schema if created by interpretAsType #4443
4.6.2 / 2016-09-30
==================
* chore: upgrade to async 2.0.1 internally #4579 [billouboq](https://github.com/billouboq)
* fix(types): ensure nested single doc schema errors reach update validators #4557 #4519
* fix(connection): handle rs names with leading numbers (muri 1.1.1) #4556
* fix(model): don't throw if method name conflicts with Object.prototype prop #4551
* docs: fix broken link #4544 [VFedyk](https://github.com/VFedyk)
* fix: allow overwriting model on mongoose singleton #4541 [Nainterceptor](https://github.com/Nainterceptor)
* fix(document): don't use init: true when building doc defaults #4540
* fix(connection): use replSet option if replset not specified #4535
* fix(query): cast $not objects #4495
4.6.1 / 2016-09-20
==================
* fix(query): improve handling of $not with $elemMatch #4531 #3719 [timbowhite](https://github.com/timbowhite)
* fix: upgrade mongodb -> 2.2.10 #4517
* chore: fix webpack build issue #4512 [saiichihashimoto](https://github.com/saiichihashimoto)
* fix(query): emit error on next tick when exec callback errors #4500
* test: improve test case #4496 [isayme](https://github.com/isayme)
* fix(schema): use same check for array types and top-level types #4493
* style: fix indentation in docs #4489 [dhurlburtusa](https://github.com/dhurlburtusa)
* fix(schema): expose original object passed to constructor #4486
* fix(query): handle findOneAndUpdate with array of arrays #4484 #4470 [fedotov](https://github.com/fedotov)
* feat(document): add $ignore to make a path ignored #4480
* fix(query): properly handle setting single embedded in update #4475 #4466 #4465
* fix(updateValidators): handle single nested schema subpaths correctly #4479
* fix(model): throw handy error when method name conflicts with property name #4475
* fix(schema): handle .set() with array field #4472
* fix(query): check nested path when avoiding double-validating Mixed #4441
* fix(schema): handle calling path.trim() with no args correctly #4042
4.6.0 / 2016-09-02
==================
* docs(document): clarify the findById and findByIdAndUpdate examples #4471 [mdcanham](https://github.com/mdcanham)
* docs(schematypes): add details re: options #4452
* docs(middleware): add docs for insertMany hooks #4451
* fix(schema): create new array when copying from existing object to preserve change tracking #4449
* docs: fix typo in index.jade #4448
* fix(query): allow array for populate options #4446
* fix(model): create should not cause unhandle reject promise #4439
* 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)
4.5.10 / 2016-08-23
===================
* docs: fix typo on documents.jade #4444 [Gabri3l](https://github.com/Gabri3l)
* chore: upgrade mocha to 3.0.2 #4437 [TrejGun](https://github.com/TrejGun)
* fix: subdocuments causing error with parent timestamp on update #4434 [dyang108](https://github.com/dyang108)
* fix(query): don't crash if timestamps on and update doesn't have a path #4425 #4424 #4418
* fix(query): ensure single nested subdoc is hydrated when running update validators #4420
* fix(query): cast non-$geometry operators for $geoWithin #4419
* docs: update contributor count #4415 [AdamZaczek](https://github.com/AdamZaczek)
* docs: add more clarification re: the index event #4410
* fix(document): only skip modifying subdoc path if parent is direct modified #4405
* fix(schema): throw cast error if provided date invalid #4404
* feat(error): use util.inspect() so CastError never prints "[object Object]" #4398
* fix(model): dont error if the discriminator key is unchanged #4387
* fix(query): don't throw unhandled rejection with bluebird when using cbs #4379
4.5.9 / 2016-08-14
==================
* docs: add mixed schema doc for Object literal #4400 [Kikobeats](https://github.com/Kikobeats)
* fix(query): cast $geoWithin and convert mongoose objects to POJOs before casting #4392
* fix(schematype): dont cast defaults without parent doc #4390
* fix(query): disallow passing empty string to findOne() #4378
* fix(document): set single nested doc isNew correctly #4369
* fix(types): checks field name correctly with nested arrays and populate #4365
* fix(drivers): make debug output copy-pastable into mongodb shell #4352
* fix(services): run update validators on nested paths #4332
* fix(model): handle typeKey with discriminators #4339
* fix(query): apply timestamps to child schemas when explicitly specified in update #4049
* fix(schema): set prefix as nested path with add() #1730
4.5.8 / 2016-08-01
==================
* fix(model): make changing the discriminator key cause a cast error #4374
* fix(query): pass projection fields to cursor #4371 #4342 [Corei13](https://github.com/Corei13)
* fix(document): support multiple paths for isModified #4370 [adambuczynski](https://github.com/adambuczynski)
* fix(querycursor): always cast fields before returning cursor #4355
* fix(query): support projection as alias for fields in findOneAndUpdate #4315
* fix(schema): treat index false + unique false as no index #4304
* fix(types): dont mark single nested subpath as modified if whole doc already modified #4224
4.5.7 / 2016-07-25
==================
* fix(document): ensure no unhandled rejections if callback specified for save #4364
4.5.6 / 2016-07-23
==================
* fix(schema): don't overwrite createdAt if it isn't selected #4351 [tusbar](https://github.com/tusbar)
* docs(api): fix link to populate() and add a new one from depopulate() #4345 [Delapouite](https://github.com/Delapouite)
* fix(types): ownerDocument() works properly with single nested docs #4344 [vichle](https://github.com/vichle)
* fix(populate): dont use findOne when justOne option set #4329
* fix(document): dont trigger .then() deprecated warning when calling doc.remove() #4291
* docs(connection): add promiseLibrary option #4280
* fix(plugins): apply global plugins to subschemas #4271
* fix(model): ensure `ensureIndex()` never calls back in the same tick #4246
* docs(schema): improve post hook docs on schema #4238
4.5.5 / 2016-07-18
==================
* fix(document): handle setting root to empty obj if minimize false #4337
* fix: downgrade to mongodb 2.1.18 #4335 #4334 #4328 #4323
* perf(types): remove defineProperty usage in documentarray #4333
* fix(query): correctly pass model in .toConstructor() #4318
* fix(services): avoid double-validating mixed types with update validators #4305
* docs(middleware): add docs describing error handling middleware #4229
* fix(types): throw correct error when invalidating doc array #3602
4.5.4 / 2016-07-11
==================
* fix(types): fix removing embedded documents #4309 [RoCat](https://github.com/RoCat)
* docs: various docs improvements #4302 #4294 [simonxca](https://github.com/simonxca)
* fix: upgrade mongodb -> 2.1.21 #4295 #4202 [RoCat](https://github.com/RoCat)
* fix(populate): convert single result to array for virtual populate because of lean #4288
* fix(populate): handle empty results for populate virtuals properly #4285 #4284
* fix(query): dont cast $inc to number if type is long #4283
* fix(types): allow setting single nested doc to null #4281
* fix(populate): handle deeply nested virtual populate #4278
* fix(document): allow setting empty obj if strict mode is false #4274