Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

History.md 258KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206
  1. 5.6.2 / 2019-06-28
  2. ==================
  3. * fix(update): allow using `update()` with immutable `createdAt` #7917
  4. * fix(model): pass `doc` parameter to save() error handling middleware #7832
  5. * fix(mongoose): add applyPluginsToChildSchemas option to allow opting out of global plugins for child schemas #7916
  6. * docs(connection): document `useCache` option for `useDb()` #7923
  7. * docs: fix broken link in FAQ #7925 [christophergeiger3](https://github.com/christophergeiger3)
  8. 5.6.1 / 2019-06-24
  9. ==================
  10. * fix(update): skip setting defaults for single embedded subdocs underneath maps #7909
  11. * fix(document): copy date objects correctly when strict = false #7907
  12. * feat(mongoose): throw an error if calling `mongoose.connect()` multiple times while connected #7905 [Fonger](https://github.com/Fonger)
  13. * fix(document): copies virtuals from array subdocs when casting array of docs with same schema #7898
  14. * fix(schema): ensure clone() copies single embedded discriminators correctly #7894
  15. * fix(discriminator): merge instead of overwriting conflicting nested schemas in discriminator schema #7884
  16. * fix(populate): ignore nullish arguments when calling `populate()` #7913 [rayhatfield](https://github.com/rayhatfield)
  17. * docs: add getters/setters tutorial #7919
  18. * docs: clean up error docs so they refer to `Error` rather than `MongooseError` #7867
  19. * docs: fix a couple broken links #7921 [kizmo04](https://github.com/kizmo04)
  20. * refactor: remove unnecessary if #7911 [rayhatfield](https://github.com/rayhatfield)
  21. 5.6.0 / 2019-06-14
  22. ==================
  23. * feat(schematype): add `immutable` option to disallow changing a given field #7671
  24. * docs: split API docs into separate pages to make API documentation more Google-able #7812
  25. * perf(array): remove all mixins in favor of ES6 classes, ~20% faster in basic benchmarks #7798
  26. * feat(document): use promise rejection error message when async custom validator throws an error #4913
  27. * feat(virtual): pass document as 3rd parameter to virtual getters and setters to enable using arrow functions #4143
  28. * feat(model): add `Model.exists()` function to quickly check whether a document matching `filter` exists #6872
  29. * feat(index+connection): support setting global and connection-level `maxTimeMS`
  30. * feat(populate): support setting `ref` to a function for conventional populate #7669
  31. * feat(document): add overwrite() function that overwrites all values in a document #7830
  32. * feat(populate): support `PopulateOptions#connection` option to allow cross-db populate with refPath #6520
  33. * feat(populate): add skipInvalidIds option to silently skip population if id is invalid, instead of throwing #7706
  34. * feat(array): skip empty array default if there's a 2dsphere index on a geojson path #3233
  35. * feat(query): add `getFilter()` as an alias of `getQuery()` to be more in line with API docs #7839
  36. * feat(model): add Model.inspect() to make models not clutter `util.inspect()` #7836
  37. * perf(discriminator): skip calling `createIndex()` on indexes that are defined in the base schema #7379
  38. * docs: upgrade from Jade to latest Pug #7812
  39. * docs(README): update reference to example schema.js #7899 [sharils](https://github.com/sharils)
  40. * docs(README): improve variable name #7900 [sharils](https://github.com/sharils)
  41. * chore: replace charAt(0) with startsWith #7897 [Fonger](https://github.com/Fonger)
  42. * chore: replace indexOf with includes, startsWith and endsWith for String #7897 [Fonger](https://github.com/Fonger)
  43. 5.5.15 / 2019-06-12
  44. ===================
  45. * fix(connection): reject initial connect promise even if there is an on('error') listener #7850
  46. * fix(map): make `of` automatically convert POJOs to schemas unless typeKey is set #7859
  47. * fix(update): use discriminator schema to cast update if discriminator key specified in filter #7843
  48. * fix(array): copy atomics from source array #7891 #7889 [jyrkive](https://github.com/jyrkive)
  49. * fix(schema): return this when Schema.prototype.add is called with Schema #7887 [Mickael-van-der-Beek](https://github.com/Mickael-van-der-Beek)
  50. * fix(document): add `numAffected` and `result` to DocumentNotFoundError for better debugging #7892 #7844
  51. 5.5.14 / 2019-06-08
  52. ===================
  53. * fix(query): correct this scope of setters in update query #7876 [Fonger](https://github.com/Fonger)
  54. * fix(model): reset modifiedPaths after successful insertMany #7852 #7873 [Fonger](https://github.com/Fonger)
  55. * fix(populate): allow using `refPath` with virtual populate #7848
  56. * fix(document): prepend private methods getValue and setValue with $ #7870 [Fonger](https://github.com/Fonger)
  57. * fix: update mongodb driver -> 3.2.7 #7871 [Fonger](https://github.com/Fonger)
  58. * docs(tutorials): add tutorial about custom casting functions #7045
  59. * docs(connection): fix outdated events document #7874 [Fonger](https://github.com/Fonger)
  60. * docs: fix typo in lean docs #7875 [tannakartikey](https://github.com/tannakartikey)
  61. * docs: move off of KeenIO for tracking and use self-hosted analytics instead
  62. 5.5.13 / 2019-06-05
  63. ===================
  64. * fix(model): support passing deleteOne options #7860 #7857 [Fonger](https://github.com/Fonger)
  65. * fix(update): run setters on array elements when doing $addToSet, $push, etc #4185
  66. * fix(model): support getting discriminator by value when creating a new model #7851
  67. * docs(transactions): add section about the `withTransaction()` helper #7598
  68. * docs(schema): clarify relationship between Schema#static() and Schema#statics #7827
  69. * docs(model): fix typo `projetion` to `projection` #7868 [dfdeagle47](https://github.com/dfdeagle47)
  70. * docs(schema): correct schema options lists #7828
  71. 5.5.12 / 2019-05-31
  72. ===================
  73. * fix(document): fix unexpected error when loading a document with a nested property named `schema` #7831
  74. * fix(model): skip applying static hooks by default if static name conflicts with query middleware (re: mongoose-delete plugin) #7790
  75. * fix(query): apply schema-level projections to the result of `findOneAndReplace()` #7654
  76. * fix: upgrade mongodb driver -> 3.2.6
  77. * docs(tutorials): add findOneAndUpdate() tutorial #7847
  78. * docs(validation): add `updateOne()` and `updateMany()` to list of update validator operations #7845
  79. * docs(model): make sure options lists in `update()` API line up #7842
  80. 5.5.11 / 2019-05-23
  81. ===================
  82. * fix(discriminator): allow numeric discriminator keys for embedded discriminators #7808
  83. * chore: add Node.js 12 to travis build matrix #7784
  84. 5.5.10 / 2019-05-20
  85. ===================
  86. * fix(discriminator): allow user-defined discriminator path in schema #7807
  87. * fix(query): ensure `findOneAndReplace()` sends `replacement` to server #7654
  88. * fix(cast): allow `[]` as a value when casting `$nin` #7806
  89. * docs(model): clarify that setters do run on `update()` by default #7801
  90. * docs: fix typo in FAQ #7821 [jaona](https://github.com/jaona)
  91. 5.5.9 / 2019-05-16
  92. ==================
  93. * fix(query): skip schema setters when casting $regexp $options #7802 [Fonger](https://github.com/Fonger)
  94. * fix(populate): don't skip populating doc array properties whose name conflicts with an array method #7782
  95. * fix(populate): make populated virtual return undefined if not populated #7795
  96. * fix(schema): handle custom setters in arrays of document arrays #7804 [Fonger](https://github.com/Fonger)
  97. * docs(tutorials): add query casting tutorial #7789
  98. 5.5.8 / 2019-05-13
  99. ==================
  100. * fix(document): run pre save hooks on nested child schemas #7792
  101. * fix(model): set $session() before validation middleware for bulkWrite/insertMany #7785 #7769 [Fonger](https://github.com/Fonger)
  102. * fix(query): make `getPopulatedPaths()` return deeply populated paths #7757
  103. * fix(query): suppress findAndModify deprecation warning when using `Model.findOneAndUpdate()` #7794
  104. * fix: upgrade mongodb -> 3.2.4 #7794
  105. * fix(document): handle a couple edge cases with atomics that happen when schema defines an array property named 'undefined' #7756
  106. * docs(discriminator): correct function parameters #7786 [gfpacheco](https://github.com/gfpacheco)
  107. 5.5.7 / 2019-05-09
  108. ==================
  109. * fix(model): set $session() before pre save middleware runs when calling save() with options #7742
  110. * fix(model): set $session before pre remove hooks run when calling remove() with options #7742
  111. * fix(schema): support `remove()` on nested path #2398
  112. * fix(map): handle setting populated map element to doc #7745
  113. * fix(query): return rawResult when inserting with options `{new:false,upsert:true,rawResult:true}` #7774 #7770 [LiaanM](https://github.com/LiaanM)
  114. * fix(schematype): remove internal `validators` option because it conflicts with Backbone #7720
  115. 5.5.6 / 2019-05-06
  116. ==================
  117. * fix(document): stop converting arrays to objects when setting non-schema path to array with strict: false #7733
  118. * fix(array): make two Mongoose arrays `assert.deepEqual()` each other if they have the same values #7700
  119. * fix(populate): support populating a path in a document array embedded in an array #7647
  120. * fix(populate): set populate virtual count to 0 if local field is empty #7731
  121. * fix(update): avoid throwing cast error if casting array filter that isn't in schema with strictQuery = false #7728
  122. * docs: fix typo in `distinct()` description #7767 [phil-r](https://github.com/phil-r)
  123. 5.5.5 / 2019-04-30
  124. ==================
  125. * fix(document): ensure nested properties within single nested subdocs get set correctly when overwriting single nested subdoc #7748
  126. * fix(document): skip non-object `validators` in schema types #7720
  127. * fix: bump mongodb driver -> 3.2.3 #7752
  128. * fix(map): disallow setting map key with special properties #7750 [Fonger](https://github.com/Fonger)
  129. 5.5.4 / 2019-04-25
  130. ==================
  131. * fix(document): avoid calling custom getters when saving #7719
  132. * fix(timestamps): handle child schema timestamps correctly when reusing child schemas #7712
  133. * fix(query): pass correct callback for _legacyFindAndModify #7736 [Fonger](https://github.com/Fonger)
  134. * fix(model+query): allow setting `replacement` parameter for `findOneAndReplace()` #7654
  135. * fix(map): make `delete()` unset the key in the database #7746 [Fonger](https://github.com/Fonger)
  136. * fix(array): use symbol for `_schema` property to avoid confusing deep equality checks #7700
  137. * fix(document): prevent `depopulate()` from removing fields with empty array #7741 #7740 [Fonger](https://github.com/Fonger)
  138. * fix: make `MongooseArray#includes` support ObjectIds #7732 #6354 [hansemannn](https://github.com/hansemannn)
  139. * fix(document): report correct validation error index when pushing onto doc array #7744 [Fonger](https://github.com/Fonger)
  140. 5.5.3 / 2019-04-22
  141. ==================
  142. * fix: add findAndModify deprecation warning that references the useFindAndModify option #7644
  143. * fix(document): handle pushing a doc onto a discriminator that contains a doc array #7704
  144. * fix(update): run setters on array elements when doing $set #7679
  145. * fix: correct usage of arguments while buffering commands #7718 [rzymek](https://github.com/rzymek)
  146. * fix(document): avoid error clearing modified subpaths if doc not defined #7715 [bitflower](https://github.com/bitflower)
  147. * refactor(array): move `_parent` property behind a symbol #7726 #7700
  148. * docs(model): list out all operations and options for `bulkWrite()` #7055
  149. * docs(aggregate): use `eachAsync()` instead of nonexistent `each()` #7699
  150. * docs(validation): add CastError validation example #7514
  151. * docs(query+model): list out all options and callback details for Model.updateX() and Query#updateX() #7646
  152. 5.5.2 / 2019-04-16
  153. ==================
  154. * fix(document): support setting nested path to non-POJO object #7639
  155. * perf(connection): remove leaked event handler in `Model.init()` so `deleteModel()` frees all memory #7682
  156. * fix(timestamps): handle custom statics that conflict with built-in functions (like mongoose-delete plugin) #7698
  157. * fix(populate): make `Document#populated()` work for populated subdocs #7685
  158. * fix(document): support `.set()` on document array underneath embedded discriminator path #7656
  159. 5.5.1 / 2019-04-11
  160. ==================
  161. * fix(document): correctly overwrite all properties when setting a single nested subdoc #7660 #7681
  162. * fix(array): allow customization of array required validator #7696 [freewil](https://github.com/freewil)
  163. * fix(discriminator): handle embedded discriminators when casting array defaults #7687
  164. * fix(collection): ensure collection functions return a promise even if disconnected #7676
  165. * fix(schematype): avoid indexing properties with `{ unique: false, index: false }` #7620
  166. * fix(aggregate): make `Aggregate#model()` with no arguments return the aggregation's model #7608
  167. 5.5.0 / 2019-04-08
  168. ==================
  169. * feat(model): support applying hooks to custom static functions #5982
  170. * feat(populate): support specifying a function as `match` #7397
  171. * perf(buffer): avoid calling `defineProperties()` in Buffer constructor #7331
  172. * feat(connection): add `plugin()` for connection-scoped plugins #7378
  173. * feat(model): add Model#deleteOne() and corresponding hooks #7538
  174. * feat(query): support hooks for `Query#distinct()` #5938
  175. * feat(model): print warning when calling create() incorrectly with a session #7535
  176. * feat(document): add Document#isEmpty() and corresponding helpers for nested paths #5369
  177. * feat(document): add `getters` option to Document#get() #7233
  178. * feat(query): add Query#projection() to get or overwrite the current projection #7384
  179. * fix(document): set full validator path on validatorProperties if `propsParameter` set on validator #7447
  180. * feat(document): add Document#directModifiedPaths() #7373
  181. * feat(document): add $locals property #7691
  182. * feat(document): add validateUpdatedOnly option that only validates modified paths in `save()` #7492 [captaincaius](https://github.com/captaincaius)
  183. * chore: upgrade MongoDB driver to v3.2.0 #7641
  184. * fix(schematype): deprecate `isAsync` option for custom validators #6700
  185. * chore(mongoose): deprecate global.MONGOOSE_DRIVER_PATH so we can be webpack-warning-free in 6.0 #7501
  186. 5.4.23 / 2019-04-08
  187. ===================
  188. * fix(document): report cast error when string path in schema is an array in MongoDB #7619
  189. * fix(query): set deletedCount on result of remove() #7629
  190. * docs(subdocs): add note about parent() and ownerDocument() to subdocument docs #7576
  191. 5.4.22 / 2019-04-04
  192. ===================
  193. * fix(aggregate): allow modifying options in pre('aggregate') hook #7606
  194. * fix(map): correctly init maps of maps when loading from MongoDB #7630
  195. * docs(model+query): add `omitUndefined` option to docs for updateX() and findOneAndX() #3486
  196. * docs: removed duplicate Query.prototype.merge() reference from doc #7684 [shihabmridha](https://github.com/shihabmridha)
  197. * docs(schema): fix shardKey type to object instead of bool #7668 [kyletsang](https://github.com/kyletsang)
  198. * docs(api): fix `Model.prototypedelete` link #7665 [pixcai](https://github.com/pixcai)
  199. 5.4.21 / 2019-04-02
  200. ===================
  201. * fix(updateValidators): run update validators correctly on Decimal128 paths #7561
  202. * fix(update): cast array filters in nested doc arrays correctly #7603
  203. * fix(document): allow .get() + .set() with aliased paths #7592
  204. * fix(document): ensure custom getters on single nested subdocs don't get persisted if toObject.getters = true #7601
  205. * fix(document): support setting subdoc path to subdoc copied using object rest `{...doc}` #7645
  206. * docs(schema): correct out-of-date list of reserved words #7593
  207. * docs(model+query): add link to update results docs and examples of using results of updateOne(), etc. #7582
  208. * docs: use atomic as opposed to $atomic consistently #7649 [720degreeLotus](https://github.com/720degreeLotus)
  209. 5.4.20 / 2019-03-25
  210. ===================
  211. * docs(tutorials): add tutorial about `lean()` #7640
  212. * fix(discriminator): fix wrong modelName being used as value to partialFilterExpression index #7635 #7634 [egorovli](https://github.com/egorovli)
  213. * fix(document): allow setters to modify `this` when overwriting single nested subdoc #7585
  214. * fix(populate): handle count option correctly with multiple docs #7573
  215. * fix(date): support declaring min/max validators as functions #7600 [ChienDevIT](https://github.com/ChienDevIT)
  216. * fix(discriminator): avoid projecting in embedded discriminator if only auto-selected path is discriminator key #7574
  217. * fix(discriminator): use discriminator model when using `new BaseModel()` with discriminator key #7586
  218. * fix(timestamps): avoid throwing if doc array has timestamps and array is undefined #7625 [serg33v](https://github.com/serg33v)
  219. * docs(document): explain DocumentNotFoundError in save() docs #7580
  220. * docs(query): fix .all() param type and add example #7612 [720degreeLotus](https://github.com/720degreeLotus)
  221. * docs: add useNewUrlParser to mongoose.connect for some pages #7615 [YC](https://github.com/YC)
  222. 5.4.19 / 2019-03-11
  223. ===================
  224. * fix(mongoose): ensure virtuals set on subdocs in global plugins get applied #7572
  225. * docs(tutorials): add "Working With Dates" tutorial #7597
  226. * docs(guide): clarify that versioning only affects array fields #7555
  227. * docs(model): list out all bulkWrite() options #7550
  228. 5.4.18 / 2019-03-08
  229. ===================
  230. * fix(document): handle nested virtuals in populated docs when parent path is projected out #7491
  231. * fix(model): make subclassed models handle discriminators correctly #7547
  232. * fix(model): remove $versionError from save options for better debug output #7570
  233. 5.4.17 / 2019-03-03
  234. ===================
  235. * fix(update): handle all positional operator when casting array filters #7540
  236. * fix(populate): handle populating nested path where top-level path is a primitive in the db #7545
  237. * fix(update): run update validators on array filters #7536
  238. * fix(document): clean modified subpaths when sorting an array #7556
  239. * fix(model): cast $setOnInsert correctly with nested docs #7534
  240. * docs: remove extra curly brace from example #7569 [kolya182](https://github.com/kolya182)
  241. 5.4.16 / 2019-02-26
  242. ===================
  243. * fix(schema): handle nested objects with `_id: false` #7524
  244. * fix(schema): don't throw error if declaring a virtual that starts with a map path name #7464
  245. * fix(browser): add stubbed `model()` function so code that uses model doesn't throw #7541 [caub](https://github.com/caub)
  246. * fix(schema): merge virtuals correctly #7563 [yoursdearboy](https://github.com/yoursdearboy)
  247. * docs(connections): add reconnectFailed to connection docs #7477
  248. * docs(index): fix typo #7553 [DenrizSusam](https://github.com/DenrizSusam)
  249. * refactor(schema): iterate over paths instead of depending on childSchemas #7554
  250. 5.4.15 / 2019-02-22
  251. ===================
  252. * fix(update): don't call schematype validators on array if using $pull with runValidators #6971
  253. * fix(schema): clone all schema types when cloning an array #7537
  254. * docs(connections): improve connectTimeoutMS docs and socketTimeoutMS docs to link to Node.js net.setTimeout() #5169
  255. * docs: fix setters example in migration guide #7546 [freewil](https://github.com/freewil)
  256. 5.4.14 / 2019-02-19
  257. ===================
  258. * fix(populate): make `getters` option handle nested paths #7521
  259. * fix(documentarray): report validation errors that occur in an array subdoc created using `create()` and then `set()` #7504
  260. * docs(schema): add examples for schema functions that didn't have any #7525
  261. * docs: add MongooseError to API docs and add list of error names
  262. * docs(CONTRIBUTING): fix link #7530 [sarpik](https://github.com/sarpik)
  263. 5.4.13 / 2019-02-15
  264. ===================
  265. * fix(query): throw handy error when using updateOne() with overwrite: true and no dollar keys #7475
  266. * fix(schema): support inheriting existing schema types using Node.js `util.inherits` like mongoose-float #7486
  267. * docs(connections): add list of connection events #7477
  268. 5.4.12 / 2019-02-13
  269. ===================
  270. * fix(connection): dont emit reconnected due to socketTimeoutMS #7452
  271. * fix(schema): revert check for `false` schema paths #7516 #7512
  272. * fix(model): don't delete unaliased keys in translateAliases #7510 [chrischen](https://github.com/chrischen)
  273. * fix(document): run single nested schematype validator if nested path has a default and subpath is modified #7493
  274. * fix(query): copy mongoose options when using `Query#merge()` #1790
  275. * fix(timestamps): don't call createdAt getters when setting updatedAt on new doc #7496
  276. * docs: improve description of ValidationError #7515 [JulioJu](https://github.com/JulioJu)
  277. * docs: add an asterisk before comment, otherwise the comment line is not generated #7513 [JulioJu](https://github.com/JulioJu)
  278. 5.4.11 / 2019-02-09
  279. ===================
  280. * fix(schema): handle `_id: false` in schema paths as a shortcut for setting the `_id` option to `false` #7480
  281. * fix(update): handle $addToSet and $push with ObjectIds and castNonArrays=false #7479
  282. * docs(model): document `session` option to `save()` #7484
  283. * chore: fix gitignore syntax #7498 [JulioJu](https://github.com/JulioJu)
  284. * docs: document that Document#validateSync returns ValidationError #7499
  285. * refactor: use consolidated `isPOJO()` function instead of constructor checks #7500
  286. 5.4.10 / 2019-02-05
  287. ===================
  288. * docs: add search bar and /search page #6706
  289. * fix: support dotted aliases #7478 [chrischen](https://github.com/chrischen)
  290. * fix(document): copy atomics when setting document array to an existing document array #7472
  291. * chore: upgrade to mongodb driver 3.1.13 #7488
  292. * docs: remove confusing references to executing a query "immediately" #7461
  293. * docs(guides+schematypes): link to custom schematypes docs #7407
  294. 5.4.9 / 2019-02-01
  295. ==================
  296. * fix(document): make `remove()`, `updateOne()`, and `update()` use the document's associated session #7455
  297. * fix(document): support passing args to hooked custom methods #7456
  298. * fix(document): avoid double calling single nested getters on `toObject()` #7442
  299. * fix(discriminator): handle global plugins modifying top-level discriminator options with applyPluginsToDiscriminators: true #7458
  300. * docs(documents): improve explanation of documents and use more modern syntax #7463
  301. * docs(middleware+api): fix a couple typos in examples #7474 [arniu](https://github.com/arniu)
  302. 5.4.8 / 2019-01-30
  303. ==================
  304. * fix(query): fix unhandled error when casting object in array filters #7431
  305. * fix(query): cast query $elemMatch to discriminator schema if discriminator key set #7449
  306. * docs: add table of contents to all guides #7430
  307. 5.4.7 / 2019-01-26
  308. ==================
  309. * fix(populate): set `populated()` when using virtual populate #7440
  310. * fix(discriminator): defer applying plugins to embedded discriminators until model compilation so global plugins work #7435
  311. * fix(schema): report correct pathtype underneath map so setting dotted paths underneath maps works #7448
  312. * fix: get debug from options using the get helper #7451 #7446 [LucGranato](https://github.com/LucGranato)
  313. * fix: use correct variable name #7443 [esben-semmle](https://github.com/esben-semmle)
  314. * docs: fix broken QueryCursor link #7438 [shihabmridha](https://github.com/shihabmridha)
  315. 5.4.6 / 2019-01-22
  316. ==================
  317. * fix(utils): make minimize leave empty objects in arrays instead of setting the array element to undefined #7322
  318. * fix(document): support passing `{document, query}` options to Schema#pre(regex) and Schema#post(regex) #7423
  319. * docs: add migrating to 5 guide to docs #7434
  320. * docs(deprecations): add instructions for fixing `count()` deprecation #7419
  321. * docs(middleware): add description and example for aggregate hooks #7402
  322. 4.13.18 / 2019-01-21
  323. ====================
  324. * fix(model): handle setting populated path set via `Document#populate()` #7302
  325. * fix(cast): backport fix from #7290 to 4.x
  326. 5.4.5 / 2019-01-18
  327. ==================
  328. * fix(populate): handle nested array `foreignField` with virtual populate #7374
  329. * fix(query): support not passing any arguments to `orFail()` #7409
  330. * docs(query): document what the resolved value for `deleteOne()`, `deleteMany()`, and `remove()` contains #7324
  331. * fix(array): allow opting out of converting non-arrays into arrays with `castNonArrays` option #7371
  332. * fix(query): ensure updateOne() doesnt unintentionally double call Schema#post(regexp) #7418
  333. 5.4.4 / 2019-01-14
  334. ==================
  335. * fix(query): run casting on arrayFilters option #7079
  336. * fix(document): support skipping timestamps on save() with `save({ timestamps: false })` #7357
  337. * fix(model): apply custom where on `Document#remove()` so we attach the shardKey #7393
  338. * docs(mongoose): document `mongoose.connections` #7338
  339. 5.4.3 / 2019-01-09
  340. ==================
  341. * fix(populate): handle `count` option when using `Document#populate()` on a virtual #7380
  342. * fix(connection): set connection state to DISCONNECTED if replica set has no primary #7330
  343. * fix(mongoose): apply global plugins to schemas nested underneath embedded discriminators #7370
  344. * fix(document): make modifiedPaths() return nested paths 1 level down on initial set #7313
  345. * fix(plugins): ensure sharding plugin works even if ObjectId has a `valueOf()` #7353
  346. 5.4.2 / 2019-01-03
  347. ==================
  348. * fix(document): ensure Document#updateOne() returns a query but still calls hooks #7366
  349. * fix(query): allow explicitly projecting out populated paths that are automatically projected in #7383
  350. * fix(document): support setting `flattenMaps` option for `toObject()` and `toJSON()` at schema level #7274
  351. * fix(query): handle merging objectids with `.where()` #7360
  352. * fix(schema): copy `.base` when cloning #7377
  353. * docs: remove links to plugins.mongoosejs.com in favor of plugins.mongoosejs.io #7364
  354. 5.4.1 / 2018-12-26
  355. ==================
  356. * fix(document): ensure doc array defaults get casted #7337
  357. * fix(document): make `save()` not crash if nested doc has a property 'get' #7316
  358. * fix(schema): allow using Schema.Types.Map as well as Map to declare a map type #7305
  359. * fix(map): make set after init mark correct path as modified #7321
  360. * fix(mongoose): don't recompile model if same collection and schema passed in to `mongoose.model()` #5767
  361. * fix(schema): improve error message when type is invalid #7303
  362. * fix(schema): add `populated` to reserved property names #7317
  363. * 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
  364. * docs(schematypes): clarify that you can add arbitrary options to a SchemaType #7340
  365. * docs(mongoose): clarify that passing same name+schema to `mongoose.model()` returns the model #5767
  366. * docs(index): add useNewUrlParser to example #7368 [JIBIN-P](https://github.com/JIBIN-P)
  367. * docs(connection): add useNewUrlParser to examples #7362 [JIBIN-P](https://github.com/JIBIN-P)
  368. * docs(discriminators): add back missing example from 'recursive embedded discriminators section' #7349
  369. * docs(schema): improve docs for string and boolean cast() #7351
  370. 5.4.0 / 2018-12-14
  371. ==================
  372. * feat(schematype): add `SchemaType.get()`, custom getters across all instances of a schematype #6912
  373. * feat(schematype): add `SchemaType.cast()`, configure casting for individual schematypes #7045
  374. * feat(schematype): add `SchemaType.checkRequired()`, configure what values pass `required` check for a schematype #7186 #7150
  375. * feat(model): add `Model.findOneAndReplace()` #7162
  376. * feat(model): add `Model.events` emitter that emits all `error`'s that occur with a given model #7125
  377. * feat(populate): add `count` option to populate virtuals, support returning # of populated docs instead of docs themselves #4469
  378. * feat(aggregate): add `.catch()` helper to make aggregations full thenables #7267
  379. * feat(query): add hooks for `deleteOne()` and `deleteMany()` #7195
  380. * feat(document): add hooks for `updateOne()` #7133
  381. * feat(query): add `Query#map()` for synchronously transforming results before post middleware runs #7142
  382. * feat(schema): support passing an array of objects or schemas to `Schema` constructor #7218
  383. * feat(populate): add `clone` option to ensure multiple docs don't share the same populated doc #3258
  384. * feat(query): add `Query#maxTimeMS()` helper #7254
  385. * fix(query): deprecate broken `Aggregate#addCursorFlag()` #7120
  386. * docs(populate): fix incorrect example #7335 [zcfan](https://github.com/zcfan)
  387. * docs(middleware): add `findOneAndDelete` to middleware list #7327 [danielkesselberg](https://github.com/danielkesselberg)
  388. 5.3.16 / 2018-12-11
  389. ===================
  390. * fix(document): handle `__proto__` in queries #7290
  391. * fix(document): use Array.isArray() instead of checking constructor name for arrays #7290
  392. * docs(populate): add section about what happens when no document matches #7279
  393. * fix(mongoose): avoid crash on `import mongoose, {Schema} from 'mongoose'` #5648
  394. 5.3.15 / 2018-12-05
  395. ===================
  396. * fix(query): handle `orFail()` with `findOneAndUpdate()` and `findOneAndDelete()` #7297 #7280
  397. * fix(document): make `save()` succeed if strict: false with a `collection` property #7276
  398. * fix(document): add `flattenMaps` option for toObject() #7274
  399. * docs(document): document flattenMaps option #7274
  400. * fix(populate): support populating individual subdoc path in document array #7273
  401. * fix(populate): ensure `model` option overrides `refPath` #7273
  402. * fix(map): don't call subdoc setters on init #7272
  403. * fix(document): use internal get() helper instead of lodash.get to support `null` projection param #7271
  404. * fix(document): continue running validateSync() for all elements in doc array after first error #6746
  405. 5.3.14 / 2018-11-27
  406. ===================
  407. * docs(api): use `openUri()` instead of legacy `open()` #7277 [artemjackson](https://github.com/artemjackson)
  408. * fix(document): don't mark date underneath single nested as modified if setting to string #7264
  409. * fix(update): set timestamps on subdocs if not using $set with no overwrite #7261
  410. * fix(document): use symbol instead of `__parent` so user code doesn't conflict #7230
  411. * fix(mongoose): allow using `mongoose.model()` without context, like `import {model} from 'mongoose'` #3768
  412. 5.3.13 / 2018-11-20
  413. ===================
  414. * fix: bump mongodb driver -> 3.1.10 #7266
  415. * fix(populate): support setting a model as a `ref` #7253
  416. * docs(schematype): add ref() function to document what is a valid `ref` path in a schematype #7253
  417. * fix(array): clean modified subpaths when calling `splice()` #7249
  418. * 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)
  419. * fix(document): report correct validation error if doc array set to primitive #7242
  420. * fix(mongoose): print warning when including server-side lib with jest jsdom environment #7240
  421. 5.3.12 / 2018-11-13
  422. ===================
  423. * 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)
  424. * fix(populate): use `instanceof` rather than class name for comparison #7237 [ivanseidel](https://github.com/ivanseidel)
  425. * docs(api): make options show up as a nested list #7232
  426. * fix(document): don't mark array as modified on init if doc array has default #7227
  427. * docs(api): link to bulk write result object in `bulkWrite()` docs #7225
  428. 5.3.11 / 2018-11-09
  429. ===================
  430. * fix(model): make parent pointers non-enumerable so they don't crash JSON.stringify() #7220
  431. * fix(document): allow saving docs with nested props with '.' using `checkKeys: false` #7144
  432. * docs(lambda): use async/await with lambda example #7019
  433. 5.3.10 / 2018-11-06
  434. ===================
  435. * fix(discriminator): support reusing a schema for multiple discriminators #7200
  436. * fix(cursor): handle `lean(false)` correctly with query cursors #7197
  437. * fix(document): avoid manual populate if `ref` not set #7193
  438. * fix(schema): handle schema without `.base` for browser build #7170
  439. * docs: add further reading section
  440. 5.3.9 / 2018-11-02
  441. ==================
  442. * fix: upgrade bson dep -> 1.1.0 to match mongodb-core #7213 [NewEraCracker](https://github.com/NewEraCracker)
  443. * docs(api): fix broken anchor link #7210 [gfranco93](https://github.com/gfranco93)
  444. * fix: don't set parent timestamps because a child has timestamps set to false #7203 #7202 [lineus](https://github.com/lineus)
  445. * fix(document): run setter only once when doing `.set()` underneath a single nested subdoc #7196
  446. * fix(document): surface errors in subdoc pre validate #7187
  447. * fix(query): run default functions after hydrating the loaded document #7182
  448. * fix(query): handle strictQuery: 'throw' with nested path correctly #7178
  449. * fix(update): update timestamps on replaceOne() #7152
  450. * docs(transactions): add example of aborting a transaction #7113
  451. 5.3.8 / 2018-10-30
  452. ==================
  453. * fix: bump mongodb driver -> 3.1.8 to fix connecting to +srv uri with no credentials #7191 #6881 [lineus](https://github.com/lineus)
  454. * fix(document): sets defaults correctly in child docs with projection #7159
  455. * fix(mongoose): handle setting custom type on a separate mongoose global #7158
  456. * fix: add unnecessary files to npmignore #7157
  457. * fix(model): set session when creating new subdoc #7104
  458. 5.3.7 / 2018-10-26
  459. ==================
  460. * fix(browser): fix buffer usage in browser build #7184 #7173 [lineus](https://github.com/lineus)
  461. * fix(document): make depopulate() work on populate virtuals and unpopulated docs #7180 #6075 [lineus](https://github.com/lineus)
  462. * fix(document): only pass properties as 2nd arg to custom validator if `propsParameter` set #7145
  463. * docs(schematypes): add note about nested paths with `type` getting converted to mixed #7143
  464. * fix(update): run update validators on nested doc when $set on an array #7135
  465. * fix(update): copy exact errors from array subdoc validation into top-level update validator error #7135
  466. 5.3.6 / 2018-10-23
  467. ==================
  468. * fix(cursor): fix undefined transforms error
  469. 5.3.5 / 2018-10-22
  470. ==================
  471. * fix(model): make sure versionKey on `replaceOne()` always gets set at top level to prevent cast errors #7138
  472. * fix(cursor): handle non-boolean lean option in `eachAsync()` #7137
  473. * fix(update): correct cast update that overwrites a map #7111
  474. * fix(schema): handle arrays of mixed correctly #7109
  475. * fix(query): use correct path when getting schema for child timestamp update #7106
  476. * fix(document): make `$session()` propagate sessions to child docs #7104
  477. * fix(document): handle user setting `schema.options.strict = 'throw'` #7103
  478. * fix(types): use core Node.js buffer prototype instead of safe-buffer because safe-buffer is broken for Node.js 4.x #7102
  479. * fix(document): handle setting single doc with refPath to document #7070
  480. * fix(model): handle array filters when updating timestamps for subdocs #7032
  481. 5.3.4 / 2018-10-15
  482. ==================
  483. * fix(schema): make `add()` and `remove()` return the schema instance #7131 [lineus](https://github.com/lineus)
  484. * fix(query): don't require passing model to `cast()` #7118
  485. * fix: support `useFindAndModify` as a connection-level option #7110 [lineus](https://github.com/lineus)
  486. * fix(populate): handle plus path projection with virtual populate #7050
  487. * fix(schema): allow using ObjectId type as schema path type #7049
  488. * docs(schematypes): elaborate on how schematypes relate to types #7049
  489. * docs(deprecations): add note about gridstore deprecation #6922
  490. * docs(guide): add storeSubdocValidationError option to guide #6802
  491. 5.3.3 / 2018-10-12
  492. ==================
  493. * fix(document): enable storing mongoose validation error in MongoDB by removing `$isValidatorError` property #7127
  494. * docs(api): clarify that aggregate triggers aggregate middleware #7126 [lineus](https://github.com/lineus)
  495. * fix(connection): handle Model.init() when an index exists on schema + autoCreate == true #7122 [jesstelford](https://github.com/jesstelford)
  496. * docs(middleware): explain how to switch between document and query hooks for `remove()` #7093
  497. * docs(api): clean up encoding issues in SchemaType.prototype.validate docs #7091
  498. * docs(schema): add schema types to api docs and update links on schematypes page #7080 #7076 [lineus](https://github.com/lineus)
  499. * docs(model): expand model constructor docs with examples and `fields` param #7077
  500. * docs(aggregate): remove incorrect description of noCursorTimeout and add description of aggregate options #7056
  501. * docs: re-add array type to API docs #7027
  502. * docs(connections): add note about `members.host` errors due to bad host names in replica set #7006
  503. 5.3.2 / 2018-10-07
  504. ==================
  505. * fix(query): make sure to return correct result from `orFail()` #7101 #7099 [gsandorx](https://github.com/gsandorx)
  506. * fix(schema): handle `{ timestamps: false }` correctly #7088 #7074 [lineus](https://github.com/lineus)
  507. * docs: fix markdown in options.useCreateIndex documentation #7085 [Cyral](https://github.com/Cyral)
  508. * docs(schema): correct field name in timestamps example #7082 [kizmo04](https://github.com/kizmo04)
  509. * docs(migrating_to_5): correct markdown syntax #7078 [gwuah](https://github.com/gwuah)
  510. * fix(connection): add useFindAndModify option in connect #7059 [NormanPerrin](https://github.com/NormanPerrin)
  511. * fix(document): dont mark single nested path as modified if setting to the same value #7048
  512. * fix(populate): use WeakMap to track lean populate models rather than leanPopulateSymbol #7026
  513. * fix(mongoose): avoid unhandled rejection when `mongoose.connect()` errors with a callback #6997
  514. * fix(mongoose): isolate Schema.Types between custom Mongoose instances #6933
  515. 5.3.1 / 2018-10-02
  516. ==================
  517. * fix(ChangeStream): expose driver's `close()` function #7068 #7022 [lineus](https://github.com/lineus)
  518. * fix(model): avoid printing warning if `_id` index is set to "hashed" #7053
  519. * fix(populate): handle nested populate underneath lean array correctly #7052
  520. * fix(update): make timestamps not crash on a null or undefined update #7041
  521. * docs(schematypes+validation): clean up links from validation docs to schematypes docs #7040
  522. * fix(model): apply timestamps to nested docs in bulkWrite() #7032
  523. * docs(populate): rewrite refPath docs to be simpler and more direct #7013
  524. * docs(faq): explain why destructuring imports are not supported in FAQ #7009
  525. 5.3.0 / 2018-09-28
  526. ==================
  527. * feat(mongoose): support `mongoose.set('debug', WritableStream)` so you can pipe debug to stderr, file, or network #7018
  528. * feat(query): add useNestedStrict option #6973 #5144 [lineus](https://github.com/lineus)
  529. * feat(query): add getPopulatedPaths helper to Query.prototype #6970 #6677 [lineus](https://github.com/lineus)
  530. * feat(model): add `createCollection()` helper to make transactions easier #6948 #6711 [Fonger](https://github.com/Fonger)
  531. * feat(schema): add ability to do `schema.add(otherSchema)` to merge hooks, virtuals, etc. #6897
  532. * feat(query): add `orFail()` helper that throws an error if no documents match `filter` #6841
  533. * feat(mongoose): support global toObject and toJSON #6815
  534. * feat(connection): add deleteModel() to remove a model from a connection #6813
  535. * feat(mongoose): add top-level mongoose.ObjectId, mongoose.Decimal128 for easier schema declarations #6760
  536. * feat(aggregate+query): support for/await/of (async iterators) #6737
  537. * feat(mongoose): add global `now()` function that you can stub for testing timestamps #6728
  538. * feat(schema): support `schema.pre(RegExp, fn)` and `schema.post(RegExp, fn)` #6680
  539. * docs(query): add better docs for the `mongooseOptions()` function #6677
  540. * feat(mongoose): add support for global strict object #6858
  541. * feat(schema+mongoose): add autoCreate option to automatically create collections #6489
  542. * feat(update): update timestamps on nested subdocs when using `$set` #4412
  543. * feat(query+schema): add query `remove` hook and ability to switch between query `remove` and document `remove` middleware #3054
  544. 5.2.18 / 2018-09-27
  545. ===================
  546. * docs(migrating_to_5): add note about overwriting filter properties #7030
  547. * fix(query): correctly handle `select('+c')` if c is not in schema #7017
  548. * fix(document): check path exists before checking for required #6974
  549. * fix(document): retain user-defined key order on initial set with nested docs #6944
  550. * fix(populate): handle multiple localFields + foreignFields using `localField: function() {}` syntax #5704
  551. 5.2.17 / 2018-09-21
  552. ===================
  553. * docs(guide): clarify that Mongoose only increments versionKey on `save()` and add a workaround for `findOneAndUpdate()` #7038
  554. * fix(model): correctly handle `createIndex` option to `ensureIndexes()` #7036 #6922 [lineus](https://github.com/lineus)
  555. * docs(migrating_to_5): add a note about changing debug output from stderr to stdout #7034 #7018 [lineus](https://github.com/lineus)
  556. * fix(query): add `setUpdate()` to allow overwriting update without changing op #7024 #7012 [lineus](https://github.com/lineus)
  557. * fix(update): find top-level version key even if there are `$` operators in the update #7003
  558. * docs(model+query): explain which operators `count()` supports that `countDocuments()` doesn't #6911
  559. 5.2.16 / 2018-09-19
  560. ===================
  561. * fix(index): use dynamic require only when needed for better webpack support #7014 #7010 [jaydp17](https://github.com/jaydp17)
  562. * fix(map): handle arrays of mixed maps #6995
  563. * fix(populate): leave justOne as null if populating underneath a Mixed type #6985
  564. * fix(populate): add justOne option to allow overriding any bugs with justOne #6985
  565. * fix(query): add option to skip adding timestamps to an update #6980
  566. * docs(model+schematype): improve docs about background indexes and init() #6966
  567. * fix: bump mongodb -> 3.1.6 to allow connecting to srv url without credentials #6955 #6881 [lineus](https://github.com/lineus)
  568. * fix(connection): allow specifying `useCreateIndex` at the connection level, overrides global-level #6922
  569. * fix(schema): throw a helpful error if setting `ref` to an invalid value #6915
  570. 5.2.15 / 2018-09-15
  571. ===================
  572. * fix(populate): handle virtual justOne correctly if it isn't set #6988
  573. * fix(populate): consistently use lowercase `model` instead of `Model` so double-populating works with existing docs #6978
  574. * fix(model): allow calling `Model.init()` again after calling `dropDatabase()` #6967
  575. * fix(populate): find correct justOne when double-populating underneath an array #6798
  576. * docs(webpack): make webpack docs use es2015 preset for correct libs and use acorn to test output is valid ES5 #6740
  577. * fix(populate): add selectPopulatedPaths option to opt out of auto-adding `populate()`-ed fields to `select()` #6546
  578. * fix(model): set timestamps on bulkWrite `insertOne` and `replaceOne` #5708
  579. 5.2.14 / 2018-09-09
  580. ===================
  581. * docs: fix wording on promise docs to not imply queries only return promises #6983 #6982 [lineus](https://github.com/lineus)
  582. * fix(map): throw TypeError if keys are not string #6956
  583. * fix(document): ensure you can `validate()` a child doc #6931
  584. * fix(populate): avoid cast error if refPath points to localFields with 2 different types #6870
  585. * fix(populate): handle populating already-populated paths #6839
  586. * fix(schematype): make ObjectIds handle refPaths when checking required #6714
  587. * fix(model): set timestamps on bulkWrite() updates #5708
  588. 5.2.13 / 2018-09-04
  589. ===================
  590. * fix(map): throw TypeError if keys are not string #6968 [Fonger](https://github.com/Fonger)
  591. * fix(update): make array op casting work with strict:false and {} #6962 #6952 [lineus](https://github.com/lineus)
  592. * fix(document): add doc.deleteOne(), doc.updateOne(), doc.replaceOne() re: deprecation warnings #6959 #6940 [lineus](https://github.com/lineus)
  593. * docs(faq+schematypes): add note about map keys needing to be strings #6957 #6956 [lineus](https://github.com/lineus)
  594. * fix(schematype): remove unused if statement #6950 #6949 [cacothi](https://github.com/cacothi)
  595. * docs: add /docs/deprecations.html for dealing with MongoDB driver deprecation warnings #6922
  596. * fix(populate): handle refPath where first element in array has no refPath #6913
  597. * fix(mongoose): allow setting useCreateIndex option after creating a model but before initial connection succeeds #6890
  598. * fix(updateValidators): ensure $pull validators always get an array #6889
  599. 5.2.12 / 2018-08-30
  600. ===================
  601. * fix(document): disallow setting `constructor` and `prototype` if strict mode false
  602. 4.13.17 / 2018-08-30
  603. ====================
  604. * fix(document): disallow setting `constructor` and `prototype` if strict mode false
  605. 5.2.11 / 2018-08-30
  606. ===================
  607. * fix(document): disallow setting __proto__ if strict mode false
  608. * fix(document): run document middleware on docs embedded in maps #6945 #6938 [Fonger](https://github.com/Fonger)
  609. * fix(query): make castForQuery return a CastError #6943 #6927 [lineus](https://github.com/lineus)
  610. * fix(query): use correct `this` scope when casting query with legacy 2dsphere pairs defined in schema #6939 #6937 [Fonger](https://github.com/Fonger)
  611. * fix(document): avoid crash when calling `get()` on deeply nested subdocs #6929 #6925 [jakemccloskey](https://github.com/jakemccloskey)
  612. * fix(plugins): make saveSubdocs execute child post save hooks _after_ the actual save #6926
  613. * docs: add dbName to api docs for .connect() #6923 [p722](https://github.com/p722)
  614. * fix(populate): convert to array when schema specifies array, even if doc doesn't have an array #6908
  615. * fix(populate): handle `justOne` virtual populate underneath array #6867
  616. * fix(model): dont set versionKey on upsert if it is already `$set` #5973
  617. 4.13.16 / 2018-08-30
  618. ====================
  619. * fix(document): disallow setting __proto__ if strict mode false
  620. * feat(error): backport adding modified paths to VersionError #6928 [freewil](https://github.com/freewil)
  621. 5.2.10 / 2018-08-27
  622. ===================
  623. * fix: bump mongodb driver -> 3.1.4 #6920 #6903 #6884 #6799 #6741 [Fonger](https://github.com/Fonger)
  624. * fix(model): track `session` option for `save()` as the document's `$session()` #6909
  625. * fix(query): add Query.getOptions() helper #6907 [Fonger](https://github.com/Fonger)
  626. * fix(document): ensure array atomics get cleared after save() #6900
  627. * fix(aggregate): add missing redact and readConcern helpers #6895 [Fonger](https://github.com/Fonger)
  628. * fix: add global option `mongoose.set('useCreateIndex', true)` to avoid ensureIndex deprecation warning #6890
  629. * fix(query): use `projection` option to avoid deprecation warnings #6888 #6880 [Fonger](https://github.com/Fonger)
  630. * fix(query): use `findOneAndReplace()` internally if using `overwrite: true` with `findOneAndUpdate()` #6888 [Fonger](https://github.com/Fonger)
  631. * fix(document): ensure required cache gets cleared correctly between subsequent saves #6892
  632. * fix(aggregate): support session chaining correctly #6886 #6885 [Fonger](https://github.com/Fonger)
  633. * fix(query): use `projection` instead of `fields` internally for `find()` and `findOne()` to avoid deprecation warning #6880
  634. * fix(populate): add `getters` option to opt in to calling getters on populate #6844
  635. 5.2.9 / 2018-08-17
  636. ==================
  637. * fix(document): correctly propagate write concern options in save() #6877 [Fonger](https://github.com/Fonger)
  638. * fix: upgrade mongodb driver -> 3.1.3 for numerous fixes #6869 #6843 #6692 #6670 [simllll](https://github.com/simllll)
  639. * fix: correct `this` scope of default functions for DocumentArray and Array #6868 #6840 [Fonger](https://github.com/Fonger)
  640. * fix(types): support casting JSON form of buffers #6866 #6863 [Fonger](https://github.com/Fonger)
  641. * fix(query): get global runValidators option correctly #6865 #6578
  642. * fix(query): add Query.prototype.setQuery() analogous to `getQuery()` #6855 #6854
  643. * docs(connections): add note about the `family` option for IPv4 vs IPv6 and add port to example URIs #6784
  644. * fix(query): get global runValidators option correctly #6578
  645. 4.13.15 / 2018-08-14
  646. ====================
  647. * fix(mongoose): add global `usePushEach` option for easier Mongoose 4.x + MongoDB 3.6 #6858
  648. * chore: fix flakey tests for 4.x #6853 [Fonger](https://github.com/Fonger)
  649. * feat(error): add version number to VersionError #6852 [freewil](https://github.com/freewil)
  650. 5.2.8 / 2018-08-13
  651. ==================
  652. * docs: update `execPopulate()` code example #6851 [WJakub](https://github.com/WJakub)
  653. * fix(document): allow passing callback to `execPopulate()` #6851
  654. * fix(populate): populate with undefined fields without error #6848 #6845 [Fonger](https://github.com/Fonger)
  655. * docs(migrating_to_5): Add `objectIdGetter` option docs #6842 [jwalton](https://github.com/jwalton)
  656. * chore: run lint in parallel and only on Node.js v10 #6836 [Fonger](https://github.com/Fonger)
  657. * fix(populate): throw helpful error if refPath excluded in query #6834
  658. * docs(migrating_to_5): add note about removing runSettersOnQuery #6832
  659. * fix: use safe-buffer to avoid buffer deprecation errors in Node.js 10 #6829 [Fonger](https://github.com/Fonger)
  660. * docs(query): fix broken links #6828 [yaynick](https://github.com/yaynick)
  661. * docs(defaults): clarify that defaults only run on undefined #6827
  662. * chore: fix flakey tests #6824 [Fonger](https://github.com/Fonger)
  663. * docs: fix custom inspect function deprecation warning in Node.js 10 #6821 [yelworc](https://github.com/yelworc)
  664. * fix(document): ensure subdocs get set to init state after save() so validators can run again #6818
  665. * fix(query): make sure embedded query casting always throws a CastError #6803
  666. * fix(document): ensure `required` function only gets called once when validating #6801
  667. * docs(connections): note that you must specify port if using `useNewUrlParser: true` #6789
  668. * fix(populate): support `options.match` in virtual populate schema definition #6787
  669. * fix(update): strip out virtuals from updates if strict: 'throw' rather than returning an error #6731
  670. 5.2.7 / 2018-08-06
  671. ==================
  672. * fix(model): check `expireAfterSeconds` option when diffing indexes in syncIndexes() #6820 #6819 [christopherhex](https://github.com/christopherhex)
  673. * chore: fix some common test flakes in travis #6816 [Fonger](https://github.com/Fonger)
  674. * chore: bump eslint and webpack to avoid bad versions of eslint-scope #6814
  675. * test(model): add delay to session tests to improve pass rate #6811 [Fonger](https://github.com/Fonger)
  676. * fix(model): support options in `deleteMany` #6810 [Fonger](https://github.com/Fonger)
  677. * fix(query): don't use $each when pushing an array into an array #6809 [lineus](https://github.com/lineus)
  678. * chore: bump mquery so eslint isn't a prod dependency #6800
  679. * fix(populate): correctly get schema type when calling `populate()` on already populated path #6798
  680. * fix(populate): propagate readConcern options in populate from parent query #6792 #6785 [Fonger](https://github.com/Fonger)
  681. * docs(connection): add description of useNewUrlParser option #6789
  682. * fix(query): make select('+path') a no-op if no select prop in schema #6785
  683. * docs(schematype+validation): document using function syntax for custom validator message #6772
  684. * fix(update): throw CastError if updating with `$inc: null` #6770
  685. * fix(connection): throw helpful error when calling `createConnection(undefined)` #6763
  686. 5.2.6 / 2018-07-30
  687. ==================
  688. * fix(document): don't double-call deeply nested custom getters when using `get()` #6779 #6637
  689. * fix(query): upgrade mquery for readConcern() helper #6777
  690. * docs(schematypes): clean up typos #6773 [sajadtorkamani](https://github.com/sajadtorkamani)
  691. * refactor(browser): fix webpack warnings #6771 #6705
  692. * fix(populate): make error reported when no `localField` specified catchable #6767
  693. * docs(connection): use correct form in createConnection example #6766 [lineus](https://github.com/lineus)
  694. * fix(connection): throw helpful error when using legacy `mongoose.connect()` syntax #6756
  695. * fix(document): handle overwriting `$session` in `execPopulate()` #6754
  696. * fix(query): propagate top-level session down to `populate()` #6754
  697. * fix(aggregate): add `session()` helper for consistency with query api #6752
  698. * fix(map): avoid infinite recursion when update overwrites a map #6750
  699. * fix(model): be consistent about passing noop callback to mongoose.model() `init()` as well as db.model() #6707
  700. 5.2.5 / 2018-07-23
  701. ==================
  702. * fix(boolean): expose `convertToTrue` and `convertToFalse` for custom boolean casting #6758
  703. * docs(schematypes): add note about what values are converted to booleans #6758
  704. * fix(document): fix(document): report castError when setting single nested doc to array #6753
  705. * docs: prefix mongoose.Schema call with new operator #6751 [sajadtorkamani](https://github.com/sajadtorkamani)
  706. * docs(query): add examples and links to schema writeConcern option for writeConcern helpers #6748
  707. * docs(middleware): clarify that init middleware is sync #6747
  708. * perf(model): create error rather than modifying stack for source map perf #6735
  709. * fix(model): throw helpful error when passing object to aggregate() #6732
  710. * fix(model): pass Model instance as context to applyGetters when calling getters for virtual populate #6726 [lineus](https://github.com/lineus)
  711. * fix(documentarray): remove `isNew` and `save` listeners on CastError because otherwise they never get removed #6723
  712. * docs(model+query): clarify when to use `countDocuments()` vs `estimatedDocumentCount()` #6713
  713. * fix(populate): correctly set virtual nestedSchemaPath when calling populate() multiple times #6644
  714. * docs(connections): add note about the `family` option for IPv4 vs IPv6 and add port to example URIs #6566
  715. 5.2.4 / 2018-07-16
  716. ==================
  717. * docs: Model.insertMany rawResult option in api docs #6724 [lineus](https://github.com/lineus)
  718. * docs: fix typo on migrating to 5 guide #6722 [iagowp](https://github.com/iagowp)
  719. * docs: update doc about keepalive #6719 #6718 [simllll](https://github.com/simllll)
  720. * fix: ensure debug mode doesn't crash with sessions #6712
  721. * fix(document): report castError when setting single nested doc to primitive value #6710
  722. * fix(connection): throw helpful error if using `new db.model(foo)(bar)` #6698
  723. * fix(model): throw readable error with better stack trace when non-cb passed to $wrapCallback() #6640
  724. 5.2.3 / 2018-07-11
  725. ==================
  726. * fix(populate): if a getter is defined on the localField, use it when populating #6702 #6618 [lineus](https://github.com/lineus)
  727. * docs(schema): add example of nested aliases #6671
  728. * fix(query): add `session()` function to queries to avoid positional argument mistakes #6663
  729. * docs(transactions): use new session() helper to make positional args less confusing #6663
  730. * fix(query+model+schema): add support for `writeConcern` option and writeConcern helpers #6620
  731. * docs(guide): add `writeConcern` option and re-add description for `safe` option #6620
  732. * docs(schema): fix broken API links #6619
  733. * docs(connections): add information re: socketTimeoutMS and connectTimeoutMS #4789
  734. 5.2.2 / 2018-07-08
  735. ==================
  736. * fix(model+query): add missing estimatedDocumentCount() function #6697
  737. * docs(faq): improve array-defaults section #6695 [lineus](https://github.com/lineus)
  738. * docs(model): fix countDocuments() docs, bad copy/paste from count() docs #6694 #6643
  739. * fix(connection): add `startSession()` helper to connection and mongoose global #6689
  740. * fix: upgrade mongodb driver -> 3.1.1 for countDocuments() fix #6688 #6666
  741. * docs(compatibility): add MongoDB 4 range #6685
  742. * fix(populate): add ability to define refPath as a function #6683 [lineus](https://github.com/lineus)
  743. * docs: add rudimentary transactions guide #6672
  744. * fix(update): make setDefaultsOnInsert handle nested subdoc updates with deeply nested defaults #6665
  745. * docs: use latest acquit-ignore to handle examples that start with acquit:ignore:start #6657
  746. * fix(validation): format `properties.message` as well as `message` #6621
  747. 5.2.1 / 2018-07-03
  748. ==================
  749. * fix(connection): allow setting the mongodb driver's useNewUrlParser option, default to false #6656 #6648 #6647
  750. * fix(model): only warn on custom _id index if index only has _id key #6650
  751. 5.2.0 / 2018-07-02
  752. ==================
  753. * feat(model): add `countDocuments()` #6643
  754. * feat(model): make ensureIndexes() fail if specifying an index on _id #6605
  755. * feat(mongoose): add `objectIdGetter` option to remove ObjectId.prototype._id #6588
  756. * feat: upgrade mongodb -> 3.1.0 for full MongoDB 4.0 support #6579
  757. * feat(query): support `runValidators` as a global option #6578
  758. * perf(schema): use WeakMap instead of array for schema stack #6503
  759. * feat(model): decorate unique discriminator indexes with partialFilterExpressions #6347
  760. * feat(model): add `syncIndexes()`, drops indexes that aren't in schema #6281
  761. * feat(document): add default getter/setter if virtual doesn't have one #6262
  762. * feat(discriminator): support discriminators on nested doc arrays #6202
  763. * feat(update): add `Query.prototype.set()` #5770
  764. 5.1.8 / 2018-07-02
  765. ==================
  766. * fix: don't throw TypeError if calling save() after original save() failed with push() #6638 [evanhenke](https://github.com/evanhenke)
  767. * fix(query): add explain() helper and don't hydrate explain output #6625
  768. * docs(query): fix `setOptions()` lists #6624
  769. * docs: add geojson docs #6607
  770. * fix: bump mongodb -> 3.0.11 to avoid cyclic dependency error with retryWrites #6109
  771. 5.1.7 / 2018-06-26
  772. ==================
  773. * docs: add npm badge to readme #6623 [VFedyk](https://github.com/VFedyk)
  774. * fix(document): don't throw parallel save error if post save hooks in parallel #6614 #6611 [lineus](https://github.com/lineus)
  775. * fix(populate): allow dynamic ref to handle >1 model getModelsMapForPopulate #6613 #6612 [jimmytsao](https://github.com/jimmytsao)
  776. * fix(document): handle `push()` on triple nested document array #6602
  777. * docs(validation): improve update validator doc headers #6577 [joeytwiddle](https://github.com/joeytwiddle)
  778. * fix(document): handle document arrays in `modifiedPaths()` with includeChildren option #5904
  779. 5.1.6 / 2018-06-19
  780. ==================
  781. * fix: upgrade mongodb -> 3.0.10
  782. * docs(model+document): clarify that `save()` returns `undefined` if passed a callback #6604 [lineus](https://github.com/lineus)
  783. * fix(schema): apply alias when adding fields with .add() #6593
  784. * docs: add full list of guides and streamline nav #6592
  785. * docs(model): add `projection` option to `findOneAndUpdate()` #6590 [lineus](https://github.com/lineus)
  786. * docs: support @static JSDoc declaration #6584
  787. * fix(query): use boolean casting logic for $exists #6581
  788. * fix(query): cast all $text options to correct values #6581
  789. * fix(model): add support synchronous pre hooks for `createModel` #6552 [profbiss](https://github.com/profbiss)
  790. * docs: add note about the `applyPluginsToDiscriminators` option #4965
  791. 5.1.5 / 2018-06-11
  792. ==================
  793. * docs(guide): rework query helper example #6575 [lineus](https://github.com/lineus)
  794. * fix(populate): handle virtual populate with embedded discriminator under single nested subdoc #6571
  795. * docs: add string option to projections that call query select #6563 [lineus](https://github.com/lineus)
  796. * style: use ES6 in collection.js #6560 [l33ds](https://github.com/l33ds)
  797. * fix(populate): add virtual ref function ability getModelsMapForPopulate #6559 #6554 [lineus](https://github.com/lineus)
  798. * docs(queries): fix link #6557 [sun1x](https://github.com/sun1x)
  799. * fix(schema): rename indexes -> getIndexes to avoid webpack duplicate declaration #6547
  800. * fix(document): support `toString()` as custom method #6538
  801. * docs: add @instance for instance methods to be more compliant with JSDoc #6516 [treble-snake](https://github.com/treble-snake)
  802. * fix(populate): avoid converting to map when using mongoose-deep-populate #6460
  803. * docs(browser): create new browser docs page #6061
  804. 5.1.4 / 2018-06-04
  805. ==================
  806. * docs(faq): add hr tags for parallel save error #6550 [lineus](https://github.com/lineus)
  807. * docs(connection): fix broken link #6545 [iblamefish](https://github.com/iblamefish)
  808. * fix(populate): honor subpopulate options #6539 #6528 [lineus](https://github.com/lineus)
  809. * fix(populate): allow population of refpath under array #6537 #6509 [lineus](https://github.com/lineus)
  810. * fix(query): dont treat $set the same as the other ops in update casting #6535 [lineus](https://github.com/lineus)
  811. * fix: bump async -> 2.6.1 #6534 #6505 [lineus](https://github.com/lineus)
  812. * fix: support using a function as validation error message #6530 [lucandrade](https://github.com/lucandrade)
  813. * fix(populate): propagate `lean()` down to subpopulate #6498 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
  814. * docs(lambda): add info on what happens if database does down between lambda function calls #6409
  815. * fix(update): allow updating embedded discriminator path if discriminator key is in filter #5841
  816. 5.1.3 / 2018-05-28
  817. ==================
  818. * fix(document): support set() on path underneath array embedded discriminator #6526
  819. * chore: update lodash and nsp dev dependencies #6514 [ChristianMurphy](https://github.com/ChristianMurphy)
  820. * fix(document): throw readable error when saving the same doc instance more than once in parallel #6511 #6456 #4064 [lineus](https://github.com/lineus)
  821. * fix(populate): set correct nestedSchemaPath for virtual underneath embedded discriminator #6501 #6487 [lineus](https://github.com/lineus)
  822. * docs(query): add section on promises and warning about not mixing promises and callbacks #6495
  823. * docs(connection): add concrete example of connecting to multiple hosts #6492 [lineus](https://github.com/lineus)
  824. * fix(populate): handle virtual populate under single nested doc under embedded discriminator #6488
  825. * fix(schema): collect indexes from embedded discriminators for autoIndex build #6485
  826. * fix(document): handle `doc.set()` underneath embedded discriminator #6482
  827. * fix(document): handle set() on path under embedded discriminator with object syntax #6482
  828. * fix(document): handle setting nested property to object with only non-schema properties #6436
  829. 4.13.14 / 2018-05-25
  830. ====================
  831. * fix(model): handle retainKeyOrder option in findOneAndUpdate() #6484
  832. 5.1.2 / 2018-05-21
  833. ==================
  834. * docs(guide): add missing SchemaTypes #6490 [distancesprinter](https://github.com/distancesprinter)
  835. * fix(map): make MongooseMap.toJSON return a serialized object #6486 #6478 [lineus](https://github.com/lineus)
  836. * fix(query): make CustomQuery inherit from model.Query for hooks #6483 #6455 [lineus](https://github.com/lineus)
  837. * fix(document): prevent default falses from being skipped by $__dirty #6481 #6477 [lineus](https://github.com/lineus)
  838. * docs(connection): document `useDb()` #6480
  839. * fix(model): skip redundant clone in insertMany #6479 [d1manson](https://github.com/d1manson)
  840. * fix(aggregate): let replaceRoot accept objects as well as strings #6475 #6474 [lineus](https://github.com/lineus)
  841. * docs(model): clarify `emit()` in mapReduce and how map/reduce are run #6465
  842. * fix(populate): flatten array to handle multi-level nested `refPath` #6457
  843. * fix(date): cast small numeric strings as years #6444 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
  844. * fix(populate): remove unmatched ids when using virtual populate on already hydrated document #6435
  845. * fix(array): use custom array class to avoid clobbered property names #6431
  846. * fix(model): handle hooks for custom methods that return promises #6385
  847. 4.13.13 / 2018-05-17
  848. ====================
  849. * fix(update): stop clobbering $in when casting update #6441 #6339
  850. * fix: upgrade async -> 2.6.0 re: security warning
  851. 5.1.1 / 2018-05-14
  852. ==================
  853. * docs(schema): add notes in api and guide about schema.methods object #6470 #6440 [lineus](https://github.com/lineus)
  854. * fix(error): add modified paths to VersionError #6464 #6433 [paglias](https://github.com/paglias)
  855. * fix(populate): only call populate with full param signature when match is not present #6458 #6451 [lineus](https://github.com/lineus)
  856. * docs: fix geoNear link in migration guide #6450 [kawache](https://github.com/kawache)
  857. * fix(discriminator): throw readable error when `create()` with a non-existent discriminator key #6434
  858. * fix(populate): add `retainNullValues` option to avoid stripping out null keys #6432
  859. * fix(populate): handle populate in embedded discriminators underneath nested paths #6411
  860. * docs(model): add change streams and ToC, make terminology more consistent #5888
  861. 5.1.0 / 2018-05-10
  862. ==================
  863. * feat(ObjectId): add `_id` getter so you can get a usable id whether or not the path is populated #6415 #6115
  864. * feat(model): add Model.startSession() #6362
  865. * feat(document): add doc.$session() and set session on doc after query #6362
  866. * feat: add Map type that supports arbitrary keys #6287 #681
  867. * feat: add `cloneSchemas` option to mongoose global to opt in to always cloning schemas before use #6274
  868. * feat(model): add `findOneAndDelete()` and `findByIdAndDelete()` #6164
  869. * feat(document): support `$ignore()` on single nested and array subdocs #6152
  870. * feat(document): add warning about calling `save()` on subdocs #6152
  871. * fix(model): make `save()` use `updateOne()` instead of `update()` #6031
  872. * feat(error): add version number to VersionError #5966
  873. * fix(query): allow `[]` as a value for `$in` when casting #5913
  874. * fix(document): avoid running validators on single nested paths if only a child path is modified #5885
  875. * feat(schema): print warning if method conflicts with mongoose internals #5860
  876. 5.0.18 / 2018-05-09
  877. ===================
  878. * fix(update): stop clobbering $in when casting update #6441 #6339 [lineus](https://github.com/lineus)
  879. * fix: upgrade mongodb driver -> 3.0.8 to fix session issue #6437 #6357 [simllll](https://github.com/simllll)
  880. * fix: upgrade bson -> 1.0.5 re: https://snyk.io/vuln/npm:bson:20180225 #6423 [ChristianMurphy](https://github.com/ChristianMurphy)
  881. * fix: look for `valueOf()` when casting to Decimal128 #6419 #6418 [lineus](https://github.com/lineus)
  882. * fix: populate array of objects with space separated paths #6414 [lineus](https://github.com/lineus)
  883. * test: add coverage for `mongoose.pluralize()` #6412 [FastDeath](https://github.com/FastDeath)
  884. * fix(document): avoid running default functions on init() if path has value #6410
  885. * fix(document): allow saving document with `null` id #6406
  886. * fix: prevent casting of populated docs in document.init #6390 [lineus](https://github.com/lineus)
  887. * fix: remove `toHexString()` helper that was added in 5.0.15 #6359
  888. 5.0.17 / 2018-04-30
  889. ===================
  890. * docs(migration): certain chars in passwords may cause connection failures #6401 [markstos](https://github.com/markstos)
  891. * fix(document): don't throw when `push()` on a nested doc array #6398
  892. * fix(model): apply hooks to custom methods if specified #6385
  893. * fix(schema): support opting out of one timestamp field but not the other for `insertMany()` #6381
  894. * fix(documentarray): handle `required: true` within documentarray definition #6364
  895. * fix(document): ensure `isNew` is set before default functions run on init #3793
  896. 5.0.16 / 2018-04-23
  897. ===================
  898. * docs(api): sort api methods based on their string property #6374 [lineus](https://github.com/lineus)
  899. * docs(connection): fix typo in `createCollection()` #6370 [mattc41190](https://github.com/mattc41190)
  900. * docs(document): remove vestigial reference to `numAffected` #6367 [ekulabuhov](https://github.com/ekulabuhov)
  901. * docs(schema): fix typo #6366 [dhritzkiv](https://github.com/dhritzkiv)
  902. * docs(schematypes): add missing `minlength` and `maxlength` docs #6365 [treble-snake](https://github.com/treble-snake)
  903. * docs(queries): fix formatting #6360 [treble-snake](https://github.com/treble-snake)
  904. * docs(api): add cursors to API docs #6353 #6344 [lineus](https://github.com/lineus)
  905. * docs(aggregate): remove reference to non-existent `.select()` method #6346
  906. * fix(update): handle `required` array with update validators and $pull #6341
  907. * fix(update): avoid setting __v in findOneAndUpdate if it is `$set` #5973
  908. 5.0.15 / 2018-04-16
  909. ===================
  910. * fix: add ability for casting from number to decimal128 #6336 #6331 [lineus](https://github.com/lineus)
  911. * docs(middleware): enumerate the ways to error out in a hook #6315
  912. * fix(document): respect schema-level depopulate option for toObject() #6313
  913. * fix: bump mongodb driver -> 3.0.6 #6310
  914. * fix(number): check for `valueOf()` function to support Decimal.js #6306 #6299 [lineus](https://github.com/lineus)
  915. * fix(query): run array setters on query if input value is an array #6277
  916. * fix(versioning): don't require matching version when using array.pull() #6190
  917. * fix(document): add `toHexString()` function so you don't need to check whether a path is populated to get an id #6115
  918. 5.0.14 / 2018-04-09
  919. ===================
  920. * fix(schema): clone aliases and alternative option syntax correctly
  921. * fix(query): call utils.toObject in query.count like in query.find #6325 [lineus](https://github.com/lineus)
  922. * docs(populate): add middleware examples #6320 [BorntraegerMarc](https://github.com/BorntraegerMarc)
  923. * docs(compatibility): fix dead link #6319 [lacivert](https://github.com/lacivert)
  924. * docs(api): fix markdown parsing for parameters #6318 #6314 [lineus](https://github.com/lineus)
  925. * fix(populate): handle space-delimited paths in array populate #6296 #6284 [lineus](https://github.com/lineus)
  926. * fix(populate): support basic virtual populate underneath embedded discriminators #6273
  927. 5.0.13 / 2018-04-05
  928. ===================
  929. * docs(faq): add middleware to faq arrow function warning #6309 [lineus](https://github.com/lineus)
  930. * docs(schema): add example to loadClass() docs #6308
  931. * docs: clean up misc typos #6304 [sfrieson](https://github.com/sfrieson)
  932. * fix(document): apply virtuals when calling `toJSON()` on a nested path #6294
  933. * refactor(connection): use `client.db()` syntax rather than double-parsing the URI #6292 #6286
  934. * docs: document new behavior of required validator for arrays #6288 [daltones](https://github.com/daltones)
  935. * fix(schema): treat set() options as user-provided options #6274
  936. * fix(schema): clone discriminators correctly #6274
  937. * fix(update): make setDefaultsOnInsert not create subdoc if only default is id #6269
  938. * docs(discriminator): clarify 3rd argument to Model.discriminator() #2596
  939. 5.0.12 / 2018-03-27
  940. ===================
  941. * docs(query): updating model name in query API docs #6280 [lineus](https://github.com/lineus)
  942. * docs: fix typo in tests #6275 [styler](https://github.com/styler)
  943. * fix: add missing `.hint()` to aggregate #6272 #6251 [lineus](https://github.com/lineus)
  944. * docs(api): add headers to each API docs section for easer nav #6261
  945. * fix(query): ensure hooked query functions always run on next tick for chaining #6250
  946. * fix(populate): ensure populated array not set to null if it isn't set #6245
  947. * fix(connection): set readyState to disconnected if initial connection fails #6244 #6131
  948. * docs(model): make `create()` params show up correctly in docs #6242
  949. * fix(model): make error handlers work with MongoDB server errors and `insertMany()` #6228
  950. * fix(browser): ensure browser document builds defaults for embedded arrays correctly #6175
  951. * fix(timestamps): set timestamps when using `updateOne()` and `updateMany()` #6282 [gualopezb](https://github.com/gualopezb)
  952. 5.0.11 / 2018-03-19
  953. ===================
  954. * fix(update): handle $pull with $in in update validators #6240
  955. * fix(query): don't convert undefined to null when casting so driver `ignoreUndefined` option works #6236
  956. * docs(middleware): add example of using async/await with middleware #6235
  957. * fix(populate): apply justOne option before `completeMany()` so it works with lean() #6234
  958. * fix(query): ensure errors in user callbacks aren't caught in init #6195 #6178
  959. * docs(connections): document dbName option for Atlas connections #6179
  960. * fix(discriminator): make child schema nested paths overwrite parent schema paths #6076
  961. 4.13.12 / 2018-03-13
  962. ====================
  963. * fix(document): make virtual get() return undefined instead of null if no getters #6223
  964. * docs: fix url in useMongoClient error message #6219 #6217 [lineus](https://github.com/lineus)
  965. * fix(discriminator): don't copy `discriminators` property from base schema #6122 #6064
  966. 5.0.10 / 2018-03-12
  967. ===================
  968. * docs(schematype): add notes re: running setters on queries #6209
  969. * docs: fix typo #6208 [kamagatos](https://github.com/kamagatos)
  970. * fix(query): only call setters once on query filter props for findOneAndUpdate and findOneAndRemove #6203
  971. * docs: elaborate on connection string changes in migration guide #6193
  972. * fix(document): skip applyDefaults if subdoc is null #6187
  973. * docs: fix schematypes docs and link to them #6176
  974. * docs(faq): add FAQs re: array defaults and casting aggregation pipelines #6184 #6176 #6170 [lineus](https://github.com/lineus)
  975. * fix(document): ensure primitive defaults are set and built-in default functions run before setters #6155
  976. * fix(query): handle single embedded embedded discriminators in castForQuery #6027
  977. 5.0.9 / 2018-03-05
  978. ==================
  979. * perf: bump mongodb -> 3.0.4 to fix SSL perf issue #6065
  980. 5.0.8 / 2018-03-03
  981. ==================
  982. * docs: remove obsolete references to `emitIndexErrors` #6186 [isaackwan](https://github.com/isaackwan)
  983. * fix(query): don't cast findOne() until exec() so setters don't run twice #6157
  984. * fix: remove document_provider.web.js file #6186
  985. * fix(discriminator): support custom discriminator model names #6100 [wentout](https://github.com/wentout)
  986. * fix: support caching calls to `useDb()` #6036 [rocketspacer](https://github.com/rocketspacer)
  987. * fix(query): add omitUndefined option so setDefaultsOnInsert can kick in on undefined #6034
  988. * fix: upgrade mongodb -> 3.0.3 for reconnectTries: 0 blocking process exit fix #6028
  989. 5.0.7 / 2018-02-23
  990. ==================
  991. * fix: support eachAsync options with aggregation cursor #6169 #6168 [vichle](https://github.com/vichle)
  992. * docs: fix link to MongoDB compound indexes docs #6162 [br0p0p](https://github.com/br0p0p)
  993. * docs(aggregate): use eachAsync instead of incorrect `each()` #6160 [simllll](https://github.com/simllll)
  994. * chore: fix benchmarks #6158 [pradel](https://github.com/pradel)
  995. * docs: remove dead link to old blog post #6154 [markstos](https://github.com/markstos)
  996. * fix: don't convert dates to numbers when updating mixed path #6146 #6145 [s4rbagamble](https://github.com/s4rbagamble)
  997. * feat(aggregate): add replaceRoot, count, sortByCount helpers #6142 [jakesjews](https://github.com/jakesjews)
  998. * fix(document): add includedChildren flag to modifiedPaths() #6134
  999. * perf: don't create wrapper function if no hooks specified #6126
  1000. * fix(schema): allow indexes on single nested subdocs for geoJSON #6113
  1001. * fix(document): allow depopulating all fields #6073
  1002. * feat(mongoose): add support for `useFindAndModify` option on singleton #5616
  1003. 5.0.6 / 2018-02-15
  1004. ==================
  1005. * refactor(query.castUpdate): avoid creating error until necessary #6137
  1006. * docs(api): fix missing api docs #6136 [lineus](https://github.com/lineus)
  1007. * fix(schema): copy virtuals when using `clone()` #6133
  1008. * fix(update): avoid digging into buffers with upsert and replaceOne #6124
  1009. * fix(schema): support `enum` on arrays of strings #6102
  1010. * fix(update): cast `$addToSet: [1, 2]` -> `$addToSet: { $each: [1, 2] }` #6086
  1011. 5.0.5 / 2018-02-13
  1012. ==================
  1013. * docs: make > show up correctly in API docs #6114
  1014. * fix(query): support `where()` overwriting primitive with object #6097
  1015. * fix(schematype): don't run internal `resetId` setter on queries with _id #6093
  1016. * fix(discriminator): don't copy `discriminators` property from base schema #6064
  1017. * fix(utils): respect `valueOf()` when merging object for update #6059
  1018. * docs(validation): fix typo 'maxLength' #4720
  1019. * fix(document): apply defaults after setting initial value so default functions don't see empty doc #3781
  1020. 5.0.4 / 2018-02-08
  1021. ==================
  1022. * docs: add lambda guide #6107
  1023. * fix(connection): add `dbName` option to work around `mongodb+srv` not supporting db name in URI #6106
  1024. * fix(schematype): fix regexp typo in ObjectId #6098 [JoshuaWise](https://github.com/JoshuaWise)
  1025. * perf(document): re-use the modifiedPaths list #6092 [tarun1793](https://github.com/tarun1793)
  1026. * fix: use console.info() instead of console.error() for debug output #6088 [yuristsepaniuk](https://github.com/yuristsepaniuk)
  1027. * docs(validation): clean up runValidators and isAsync options docs for 5.x #6083
  1028. * docs(model): use array instead of spread consistently for aggregate() #6070
  1029. * fix(schema): make aliases handle mongoose-lean-virtuals #6069
  1030. * docs(layout): add link to subdocs guide #6056
  1031. * fix(query): make strictQuery: true strip out fields that aren't in the schema #6032
  1032. * docs(guide): add notes for `strictQuery` option #6032
  1033. 4.13.11 / 2018-02-07
  1034. ====================
  1035. * docs: fix links in 4.x docs #6081
  1036. * chore: add release script that uses --tag for npm publish for 4.x releases #6063
  1037. 5.0.3 / 2018-01-31
  1038. ==================
  1039. * fix: consistently use process.nextTick() to avoid sinon.useFakeTimers() causing ops to hang #6074
  1040. * docs(aggregate): fix typo #6072 [adursun](https://github.com/adursun)
  1041. * chore: add return type to `mongoose.model()` docs [bryant1410](https://github.com/bryant1410)
  1042. * fix(document): depopulate push()-ed docs when saving #6048
  1043. * fix: upgrade mongodb -> 3.0.2 #6019
  1044. 5.0.2 / 2018-01-28
  1045. ==================
  1046. * fix(schema): do not overwrite default values in schema when nested timestamps are provided #6024 [cdeveas](https://github.com/cdeveas)
  1047. * docs: fix syntax highlighting in models.jade, schematypes.jade, subdocs.jade #6058 [lineus](https://github.com/lineus)
  1048. * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
  1049. * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
  1050. * fix(populate): handle populating embedded discriminator paths #5970
  1051. 4.13.10 / 2018-01-28
  1052. ====================
  1053. * docs(model+query): add lean() option to Model helpers #5996 [aguyinmontreal](https://github.com/aguyinmontreal)
  1054. * fix: use lazy loading so we can build mongoose with webpack #5993 #5842
  1055. * docs(connections): clarify multi-mongos with useMongoClient for 4.x docs #5984
  1056. * fix(populate): handle populating embedded discriminator paths #5970
  1057. * docs(query+aggregate): add more detail re: maxTimeMS #4066
  1058. 5.0.1 / 2018-01-19
  1059. ==================
  1060. * fix(document): make validate() not resolve to document #6014
  1061. * fix(model): make save() not return DocumentNotFoundError if using fire-and-forget writes #6012
  1062. * fix(aggregate): make options() work as advertised #6011 [spederiva](https://github.com/spederiva)
  1063. * docs(queries): fix code samples #6008
  1064. 5.0.0 / 2018-01-17
  1065. ==================
  1066. * test: refactor tests to use start fewer connections #5985 [fenanquin](https://github.com/fenanquin)
  1067. * feat: add global bufferCommands option #5879
  1068. * docs: new docs site and build system #5976
  1069. * test: increase timeout on slow test cases #5968 [fenanquin](https://github.com/fenanquin)
  1070. * fix: avoid casting out array filter elements #5965
  1071. * feat: add Model.watch() wrapper #5964
  1072. * chore: replace istanbul with nyc #5962 [ChristianMurphy](https://github.com/ChristianMurphy)
  1073. 4.13.9 / 2018-01-07
  1074. ===================
  1075. * chore: update marked (dev dependency) re: security vulnerability #5951 [ChristianMurphy](https://github.com/ChristianMurphy)
  1076. * fix: upgrade mongodb -> 2.2.34 for ipv6 and autoReconnect fixes #5794 #5760
  1077. * docs: use useMongooseAggCursor for aggregate docs #2955
  1078. 5.0.0-rc2 / 2018-01-04
  1079. ======================
  1080. * fix: add cleaner warning about no longer needing `useMongoClient` in 5.x #5961
  1081. * chore: update acquit -> 0.5.1 for minor security patch #5961 [ChristianMurphy](https://github.com/ChristianMurphy)
  1082. * docs: add docs for mongoose 4.x at http://mongoosejs.com/docs/4.x #5959
  1083. * docs: add link to migration guide #5957
  1084. * chore: update eslint to version 4.14.0 #5955 [ChristianMurphy](https://github.com/ChristianMurphy)
  1085. * chore: update mocha to version 4.1.0 [ChristianMurphy](https://github.com/ChristianMurphy)
  1086. 5.0.0-rc1 / 2018-01-02
  1087. ======================
  1088. * fix(index): use pluralize correctly for `mongoose.model()` #5958
  1089. * fix: make mquery use native promises by default #5945
  1090. * fix(connection): ensure 'joined' and 'left' events get bubbled up #5944
  1091. 5.0.0-rc0 / 2017-12-28
  1092. ======================
  1093. * BREAKING CHANGE: always use mongoose aggregation cursor when using `.aggregate().cursor()` #5941
  1094. * BREAKING CHANGE: attach query middleware when compiling model #5939
  1095. * BREAKING CHANGE: `emitIndexErrors` is on by default, failing index build will throw uncaught error if not handled #5910
  1096. * BREAKING CHANGE: remove precompiled browser bundle #5895
  1097. * feat: add `mongoose.pluralize()` function #5877
  1098. * BREAKING CHANGE: remove `passRawResult` option for `findOneAndUpdate`, use `rawResult` #5869
  1099. * BREAKING CHANGE: implicit async validators (based on number of function args) are removed, return a promise instead #5824
  1100. * BREAKING CHANGE: fail fast if user sets a unique index on `_id` #5820 [varunjayaraman](https://github.com/varunjayaraman)
  1101. * BREAKING CHANGE: mapReduce resolves to an object with 2 keys rather than 2 separate args #5816
  1102. * BREAKING CHANGE: `mongoose.connect()` returns a promise, removed MongooseThenable #5796
  1103. * BREAKING CHANGE: query stream removed, use `cursor()` instead #5795
  1104. * BREAKING CHANGE: connection `open()` and `openSet()` removed, use `openUri()` instead #5795
  1105. * BREAKING CHANGE: use MongoDB driver 3.0.0, drop support for MongoDB server < 3.0.0 #5791 #4740
  1106. * BREAKING CHANGE: remove support for `$pushAll`, remove `usePushEach` option #5670
  1107. * BREAKING CHANGE: make date casting use native Date #5395 [varunjayaraman](https://github.com/varunjayaraman)
  1108. * BREAKING CHANGE: remove `runSettersOnQuery`, always run setters on query #5340
  1109. * BREAKING CHANGE: array of length 0 now satisfies `required: true` for arays #5139 [wlingke](https://github.com/wlingke)
  1110. * BREAKING CHANGE: remove `saveErrorIfNotFound`, always error out if `save()` did not update a document #4973
  1111. * BREAKING CHANGE: don't execute getters in reverse order #4835
  1112. * BREAKING CHANGE: make boolean casting more strict #4245
  1113. * BREAKING CHANGE: `toObject()` and `toJSON()` option parameter merges with defaults rather than overwriting #4131
  1114. * feat: allow setting `default` on `_id` #4069
  1115. * BREAKING CHANGE: `deleteX()` and `remove()` promise resolves to the write object result #4013
  1116. * feat: support returning a promise from middleware functions #3779
  1117. * BREAKING CHANGE: don't return a promise if callback specified #3670
  1118. * BREAKING CHANGE: only cast `update()`, `updateX()`, `replaceOne()`, `remove()`, `deleteX()` in exec #3529
  1119. * BREAKING CHANGE: sync errors in middleware functions are now handled #3483
  1120. * BREAKING CHANGE: post hooks get flow control #3232
  1121. * BREAKING CHANGE: deduplicate hooks when merging discriminator schema #2945
  1122. * BREAKING CHANGE: use native promises by default, remove support for mpromise #2917
  1123. * BREAKING CHANGE: remove `retainKeyOrder`, always use forward order when iterating through objects #2749
  1124. * BREAKING CHANGE: `aggregate()` no longer accepts a spread #2716
  1125. 4.13.8 / 2017-12-27
  1126. ===================
  1127. * docs(guide): use more up-to-date syntax for autoIndex example #5933
  1128. * docs: fix grammar #5927 [abagh0703](https://github.com/abagh0703)
  1129. * fix: propagate lean options to child schemas #5914
  1130. * fix(populate): use correct model with discriminators + nested populate #5858
  1131. 4.13.7 / 2017-12-11
  1132. ===================
  1133. * docs(schematypes): fix typo #5889 [gokaygurcan](https://github.com/gokaygurcan)
  1134. * fix(cursor): handle `reject(null)` with eachAsync callback #5875 #5874 [ZacharyRSmith](https://github.com/ZacharyRSmith)
  1135. * fix: disallow setting `mongoose.connection` to invalid values #5871 [jinasonlin](https://github.com/jinasonlin)
  1136. * docs(middleware): suggest using `return next()` to stop middleware execution #5866
  1137. * docs(connection): improve connection string query param docs #5864
  1138. * fix(document): run validate hooks on array subdocs even if not directly modified #5861
  1139. * fix(discriminator): don't treat $meta as defining projection when querying #5859
  1140. * fix(types): handle Decimal128 when using bson-ext on server side #5850
  1141. * fix(document): ensure projection with only $slice isn't treated as inclusive for discriminators #4991
  1142. * fix(model): throw error when passing non-object to create() #2037
  1143. 4.13.6 / 2017-12-02
  1144. ===================
  1145. * fix(schema): support strictBool option in schema #5856 [ekulabuhov](https://github.com/ekulabuhov)
  1146. * fix(update): make upsert option consistently handle truthy values, not just booleans, for updateOne() #5839
  1147. * refactor: remove unnecessary constructor check #2057
  1148. * docs(query): correct function signature for .mod() helper #1806
  1149. * fix(query): report ObjectParameterError when passing non-object as filter to find() and findOne() #1698
  1150. 4.13.5 / 2017-11-24
  1151. ===================
  1152. * fix(model): handle update cast errors correctly with bulkWrite #5845 [Michael77](https://github.com/Michael77)
  1153. * docs: add link to bufferCommands option #5844 [ralphite](https://github.com/ralphite)
  1154. * fix(model): allow virtual ref function to return arrays #5834 [brunohcastro](https://github.com/brunohcastro)
  1155. * fix(query): don't throw uncaught error if query filter too big #5812
  1156. * fix(document): if setting unselected nested path, don't overwrite nested path #5800
  1157. * fix(document): support calling `populate()` on nested document props #5703
  1158. * fix: add `strictBool` option for schema type boolean #5344 #5211 #4245
  1159. * docs(faq): add faq re: typeKey #1886
  1160. * docs(query): add more detailed docs re: options #1702
  1161. 4.13.4 / 2017-11-17
  1162. ===================
  1163. * fix(aggregate): add chainable .option() helper for setting arbitrary options #5829
  1164. * fix(aggregate): add `.pipeline()` helper to get the current pipeline #5825
  1165. * docs: grammar fixes for `unique` FAQ #5823 [mfluehr](https://github.com/mfluehr)
  1166. * chore: add node 9 to travis #5822 [superheri](https://github.com/superheri)
  1167. * fix(model): fix infinite recursion with recursive embedded discriminators #5821 [Faibk](https://github.com/Faibk)
  1168. 4.13.3 / 2017-11-15
  1169. ===================
  1170. * chore: add node 8 to travis #5818 [superheri](https://github.com/superheri)
  1171. * fix(document): don't apply transforms to nested docs when updating already saved doc #5807
  1172. 4.13.2 / 2017-11-11
  1173. ===================
  1174. * feat(buffer): add support for subtype prop #5530
  1175. 4.13.1 / 2017-11-08
  1176. ===================
  1177. * fix: accept multiple paths or array of paths to depopulate #5798 #5797 [adamreisnz](https://github.com/adamreisnz)
  1178. * fix(document): pass default array as actual array rather than taking first element #5780
  1179. * fix(model): increment version when $set-ing it in a save() that requires a version bump #5779
  1180. * fix(query): don't explicitly project in discriminator key if user projected in parent path #5775 #5754
  1181. * fix(model): cast query option to geoNear() #5765
  1182. * fix(query): don't treat projection with just $slice as inclusive #5737
  1183. * fix(discriminator): defer applying embedded discriminator hooks until top-level model is compiled #5706
  1184. * docs(discriminator): add warning to always attach hooks before calling discriminator() #5706
  1185. 4.13.0 / 2017-11-02
  1186. ===================
  1187. * feat(aggregate): add $addFields helper #5740 [AyushG3112](https://github.com/AyushG3112)
  1188. * feat(connection): add connection-level bufferCommands #5720
  1189. * feat(connection): add createCollection() helper #5712
  1190. * feat(populate): support setting localField and foreignField to functions #5704 #5602
  1191. * feat(query): add multipleCastError option for aggregating cast errors when casting update #5609
  1192. * feat(populate): allow passing a function to virtual ref #5602
  1193. * feat(schema): add excludeIndexes option to optionally prevent collecting indexes from nested schemas #5575
  1194. * feat(model): report validation errors from `insertMany()` if using `ordered: false` and `rawResult: true` #5337
  1195. * feat(aggregate): add pre/post aggregate middleware #5251
  1196. * feat(schema): allow using `set` as a schema path #1939
  1197. 4.12.6 / 2017-11-01
  1198. ===================
  1199. * fix(schema): make clone() copy query helpers correctly #5752
  1200. * fix: undeprecate `ensureIndex()` and use it by default #3280
  1201. 4.12.5 / 2017-10-29
  1202. ===================
  1203. * fix(query): correctly handle `$in` and required for $pull and update validators #5744
  1204. * feat(aggegate): add $addFields pipeline operator #5740 [AyushG3112](https://github.com/AyushG3112)
  1205. * fix(document): catch sync errors in document pre hooks and report as error #5738
  1206. * fix(populate): handle slice projections correctly when automatically selecting populated fields #5737
  1207. * fix(discriminator): fix hooks for embedded discriminators #5706 [wlingke](https://github.com/wlingke)
  1208. * fix(model): throw sane error when customer calls `mongoose.Model()` over `mongoose.model()` #2005
  1209. 4.12.4 / 2017-10-21
  1210. ===================
  1211. * test(plugins): add coverage for idGetter with id as a schema property #5713 [wlingke](https://github.com/wlingke)
  1212. * fix(model): avoid copying recursive $$context object when creating discriminator after querying #5721
  1213. * fix(connection): ensure connection promise helpers are removed before emitting 'connected' #5714
  1214. * docs(schema): add notes about runSettersOnQuery to schema setters #5705
  1215. * fix(collection): ensure queued operations run on the next tick #5562
  1216. 4.12.3 / 2017-10-16
  1217. ===================
  1218. * fix(connection): emit 'reconnect' event as well as 'reconnected' for consistency with driver #5719
  1219. * fix: correctly bubble up left/joined events for replica set #5718
  1220. * fix(connection): allow passing in `autoIndex` as top-level option rather than requiring `config.autoIndex` #5711
  1221. * docs(connection): improve docs regarding reconnectTries, autoReconnect, and bufferMaxEntries #5711
  1222. * fix(query): handle null with addToSet/push/pull/pullAll update validators #5710
  1223. * fix(model): handle setDefaultsOnInsert option for bulkWrite updateOne and updateMany #5708
  1224. * fix(query): avoid infinite recursion edge case when cloning a buffer #5702
  1225. 4.12.2 / 2017-10-14
  1226. ===================
  1227. * docs(faq): add FAQ about using arrow functions for getters/setters, virtuals, and methods #5700
  1228. * docs(schema): document the childSchemas property and add to public API #5695
  1229. * fix(query): don't project in populated field if parent field is already projected in #5669
  1230. * fix: bump mongodb -> 2.2.33 for issue with autoReconnect #4513
  1231. 4.12.1 / 2017-10-08
  1232. ===================
  1233. * fix(document): create new doc when setting single nested, no more set() on copy of priorVal #5693
  1234. * fix(model): recursively call applyMethods on child schemas for global plugins #5690
  1235. * docs: fix bad promise lib example on home page #5686
  1236. * fix(query): handle false when checking for inclusive/exclusive projection #5685
  1237. * fix(discriminator): allow reusing child schema #5684
  1238. * fix: make addToSet() on empty array with subdoc trigger manual population #5504
  1239. 4.12.0 / 2017-10-02
  1240. ===================
  1241. * docs(validation): add docs coverage for ValidatorError.reason #5681
  1242. * feat(discriminator): always add discriminatorKey to base schema to allow updating #5613
  1243. * fix(document): make nested docs no longer inherit parent doc's schema props #5586 #5546 #5470
  1244. * feat(query): run update validators on $pull and $pullAll #5555
  1245. * feat(query): add .error() helper to query to error out in pre hooks #5520
  1246. * feat(connection): add dropCollection() helper #5393
  1247. * feat(schema): add schema-level collation option #5295
  1248. * feat(types): add `discriminator()` function for single nested subdocs #5244
  1249. * feat(document): add $isDeleted() getter/setter for better support for soft deletes #4428
  1250. * feat(connection): bubble up reconnectFailed event when driver gives up reconnecting #4027
  1251. * fix(query): report error if passing array or other non-object as filter to update query #3677
  1252. * fix(collection): use createIndex() instead of deprecated ensureIndex() #3280
  1253. 4.11.14 / 2017-09-30
  1254. ====================
  1255. * chore: add nsp check to the CI build #5679 [hairyhenderson](https://github.com/hairyhenderson)
  1256. * fix: bump mquery because of security issue with debug package #5677 #5675 [jonathanprl](https://github.com/jonathanprl)
  1257. * fix(populate): automatically select() populated()-ed fields #5669
  1258. * fix(connection): make force close work as expected #5664
  1259. * fix(document): treat $elemMatch as inclusive projection #5661
  1260. * docs(model/query): clarify which functions fire which middleware #5654
  1261. * fix(model): make `init()` public and return a promise that resolves when indexes are done building #5563
  1262. 4.11.13 / 2017-09-24
  1263. ====================
  1264. * fix(query): correctly run replaceOne with update validators #5665 [sime1](https://github.com/sime1)
  1265. * fix(schema): replace mistype in setupTimestamp method #5656 [zipp3r](https://github.com/zipp3r)
  1266. * fix(query): avoid throwing cast error for strict: throw with nested id in query #5640
  1267. * fix(model): ensure class gets combined schema when using class syntax with discriminators #5635
  1268. * fix(document): handle setting doc array to array of top-level docs #5632
  1269. * fix(model): handle casting findOneAndUpdate() with overwrite and upsert #5631
  1270. * fix(update): correctly handle $ in updates #5628
  1271. * fix(types): handle manual population consistently for unshift() and splice() #5504
  1272. 4.11.12 / 2017-09-18
  1273. ====================
  1274. * docs(model): asterisk should not render as markdown bullet #5644 [timkinnane](https://github.com/timkinnane)
  1275. * docs: use useMongoClient in connection example #5627 [GabrielNicolasAvellaneda](https://github.com/GabrielNicolasAvellaneda)
  1276. * fix(connection): call callback when initial connection failed #5626
  1277. * fix(query): apply select correctly if a given nested schema is used for 2 different paths #5603
  1278. * fix(document): add graceful fallback for setting a doc array value and `pull()`-ing a doc #3511
  1279. 4.11.11 / 2017-09-10
  1280. ====================
  1281. * fix(connection): properly set readyState in response to driver 'close' and 'reconnect' events #5604
  1282. * fix(document): ensure single embedded doc setters only get called once, with correct value #5601
  1283. * fix(timestamps): allow enabling updatedAt without createdAt #5598
  1284. * test: improve unique validator test by making create run before ensureIndex #5595 #5562
  1285. * fix(query): ensure find callback only gets called once when post init hook throws error #5592
  1286. 4.11.10 / 2017-09-03
  1287. ====================
  1288. * docs: add KeenIO tracking #5612
  1289. * fix(schema): ensure validators declared with `.validate()` get copied with clone() #5607
  1290. * fix: remove unnecessary jest warning #5480
  1291. * fix(discriminator): prevent implicit discriminator schema id from clobbering base schema custom id #5591
  1292. * fix(schema): hide schema objectid warning for non-hex strings of length 24 #5587
  1293. * docs(populate): use story schema defined key author instead of creator #5578 [dmric](https://github.com/dmric)
  1294. * docs(document): describe usage of `.set()` #5576
  1295. * fix(document): ensure correct scope in single nested validators #5569
  1296. * fix(populate): don't mark path as populated until populate() is done #5564
  1297. * fix(document): make push()-ing a doc onto an empty array act as manual population #5504
  1298. * fix(connection): emit timeout event on socket timeout #4513
  1299. 4.11.9 / 2017-08-27
  1300. ===================
  1301. * fix(error): avoid using arguments.callee because that breaks strict mode #5572
  1302. * docs(schematypes): fix spacing #5567
  1303. * fix(query): enforce binary subtype always propagates to mongodb #5551
  1304. * fix(query): only skip castForQuery for mongoose arrays #5536
  1305. * fix(browser): rely on browser entrypoint to decide whether to use BrowserDocument or NodeDocument #5480
  1306. 4.11.8 / 2017-08-23
  1307. ===================
  1308. * feat: add warning about using schema ObjectId as type ObjectId #5571 [efkan](https://github.com/efkan)
  1309. * fix(schema): allow setting `id` property after schema was created #5570 #5548
  1310. * docs(populate): remove confusing _ from populate docs #5560
  1311. * fix(connection): expose parsed uri fields (host, port, dbname) when using openUri() #5556
  1312. * docs: added type boolean to options documentation #5547 [ndabAP](https://github.com/ndabAP)
  1313. * test: add test coverage for stopping/starting server #5524
  1314. * fix(aggregate): pull read preference from schema by default #5522
  1315. 4.11.7 / 2017-08-14
  1316. ===================
  1317. * fix: correct properties when calling toJSON() on populated virtual #5544 #5442 [davidwu226](https://github.com/davidwu226)
  1318. * docs: fix spelling #5535 [et](https://github.com/et)
  1319. * fix(error): always set name before stack #5533
  1320. * fix: add warning about running jest in jsdom environment #5532 #5513 #4943
  1321. * fix(document): ensure overwriting a doc array cleans out individual docs #5523
  1322. * fix(schema): handle creating arrays of single nested using type key #5521
  1323. * fix: upgrade mongodb -> 2.2.31 to support user/pass options #5419
  1324. 4.11.6 / 2017-08-07
  1325. ===================
  1326. * fix: limiting number of async operations per time in insertMany #5529 [andresattler](https://github.com/andresattler)
  1327. * fix: upgrade mongodb -> 2.2.30 #5517
  1328. * fix(browserDocument): prevent stack overflow caused by double-wrapping embedded doc save() in jest #5513
  1329. * fix(document): clear single nested doc when setting to empty object #5506
  1330. * fix(connection): emit reconnected and disconnected events correctly with useMongoClient #5498
  1331. * fix(populate): ensure nested virtual populate gets set even if top-level property is null #5431
  1332. 4.11.5 / 2017-07-30
  1333. ===================
  1334. * docs: fix link to $lookup #5516 [TalhaAwan](https://github.com/TalhaAwan)
  1335. * fix: better parallelization for eachAsync #5502 [lchenay](https://github.com/lchenay)
  1336. * docs(document): copy docs for save from model to doc #5493
  1337. * fix(document): handle dotted virtuals in toJSON output #5473
  1338. * fix(populate): restore user-provided limit after mutating so cursor() works with populate limit #5468
  1339. * fix(query): don't throw StrictModeError if geo query with upsert #5467
  1340. * fix(populate): propagate readPreference from query to populate queries by default #5460
  1341. * docs: warn not to use arrow functions for statics and methods #5458
  1342. * fix(query): iterate over all condition keys for setDefaultsOnInsert #5455
  1343. * docs(connection): clarify server/replset/mongos option deprecation with useMongoClient #5442
  1344. 4.11.4 / 2017-07-23
  1345. ===================
  1346. * fix: handle next() errors in `eachAsync()` #5486 [lchenay](https://github.com/lchenay)
  1347. * fix(schema): propagate runSettersOnQuery option to implicitly created schemas #5479 [https://github.com/ValYouW]
  1348. * fix(query): run castConditions() correctly in update ops #5477
  1349. * fix(query): ensure castConditions called for findOne and findOneAnd* #5477
  1350. * docs: clarify relationship between $lookup and populate #5475 [TalhaAwan](https://github.com/TalhaAwan)
  1351. * test: add coverage for arrays of arrays [zbjornson](https://github.com/zbjornson)
  1352. * fix(middleware): ensure that error handlers for save get doc as 2nd param #5466
  1353. * fix: handle strict: false correctly #5454 #5453 [wookieb](https://github.com/wookieb)
  1354. * fix(query): apply schema excluded paths if only projection is a $slice #5450
  1355. * fix(query): correct discriminator handling for schema `select: false` fields in schema #5448
  1356. * fix(cursor): call next() in series when parallel option used #5446
  1357. * chore: load bundled driver first to avoid packaging problem #5443 [prototypeme](https://github.com/prototypeme)
  1358. * fix(query): defer condition casting until final exec #5434
  1359. * fix(aggregate): don't rely on mongodb aggregate to put a cursor in the callback #5394
  1360. * docs(aggregate): add useMongooseAggCursor docs #5394
  1361. * docs(middleware): clarify context for document, query, and model middleware #5381
  1362. 4.11.3 / 2017-07-14
  1363. ===================
  1364. * fix(connection): remove .then() before resolving to prevent infinite recursion #5471
  1365. 4.11.2 / 2017-07-13
  1366. ===================
  1367. * docs: fix comment typo in connect example #5435 [ConnorMcF](https://github.com/ConnorMcF)
  1368. * fix(update): correctly cast document array in update validators with exec() #5430
  1369. * fix(connection): handle autoIndex with useMongoClient #5423
  1370. * fix(schema): handle `type: [Array]` in schemas #5416
  1371. * fix(timestamps): if overwrite is set and there's a $set, use $set instead of top-level update #5413
  1372. * fix(document): don't double-validate deeply nested doc array elements #5411
  1373. * fix(schematype): clone default objects so default not shared across object instances unless `shared` specified #5407
  1374. * fix(document): reset down the nested subdocs when resetting parent doc #5406
  1375. * fix: don't pass error arg twice to error handlers #5405
  1376. * fix(connection): make openUri() return connection decorated with then() and catch() #5404
  1377. * fix: enforce $set on an array must be an array #5403
  1378. * fix(document): don't crash if calling `validateSync()` after overwriting doc array index #5389
  1379. * fix(discriminator): ensure discriminator key doesn't count as user-selected field for projection #4629
  1380. 4.11.1 / 2017-07-02
  1381. ===================
  1382. * docs: populate virtuals fix justOne description #5427 [fredericosilva](https://github.com/fredericosilva)
  1383. * fix(connection): make sure to call onOpen in openUri() #5404
  1384. * docs(query): justOne is actually single, and it default to false #5402 [zbjornson](https://github.com/zbjornson)
  1385. * docs: fix small typo in lib/schema.js #5398 #5396 [pjo336](https://github.com/pjo336)
  1386. * fix: emit remove on single nested subdocs when removing parent #5388
  1387. * fix(update): handle update with defaults and overwrite but no update validators #5384
  1388. * fix(populate): handle undefined refPath values in middle of array #5377
  1389. * fix(document): ensure consistent setter context for single nested #5363
  1390. * fix(query): support runSettersOnQuery as query option #5350
  1391. 4.11.0 / 2017-06-25
  1392. ===================
  1393. * feat(query): execute setters with query as context for `runSettersOnQuery` #5339
  1394. * feat(model): add translateAliases function #5338 [rocketspacer](https://github.com/rocketspacer)
  1395. * feat(connection): add `useMongoClient` and `openUri` functions, deprecate current connect logic #5304
  1396. * refactor(schema): make id virtual not access doc internals #5279
  1397. * refactor: handle non-boolean lean #5279
  1398. * feat(cursor): add addCursorFlag() support to query and agg cursors #4814
  1399. * feat(cursor): add parallel option to eachAsync #4244
  1400. * feat(schema): allow setting custom error constructor for custom validators #4009
  1401. 4.10.8 / 2017-06-21
  1402. ===================
  1403. * docs: fix small formatting typo on schematypes #5374 [gianpaj](https://github.com/gianpaj)
  1404. * fix(model): allow null as an _id #5370
  1405. * fix(populate): don't throw async uncaught exception if model not found in populate #5364
  1406. * fix: correctly cast decimals in update #5361
  1407. * fix(error): don't use custom getter for ValidationError message #5359
  1408. * fix(query): handle runSettersOnQuery in built-in _id setter #5351
  1409. * fix(document): ensure consistent context for nested doc custom validators #5347
  1410. 4.10.7 / 2017-06-18
  1411. ===================
  1412. * docs(validation): show overriding custom validator error with 2nd cb arg #5358
  1413. * fix: `parseOption` mutates user passed option map #5357 [igwejk](https://github.com/igwejk)
  1414. * docs: fix guide.jade typo #5356 [CalebAnderson2014](https://github.com/CalebAnderson2014)
  1415. * fix(populate): don't set populate virtual to ids when match fails #5336
  1416. * fix(query): callback with cast error if remove and delete* args have a cast error #5323
  1417. 4.10.6 / 2017-06-12
  1418. ===================
  1419. * fix(cursor): handle custom model option for populate #5334
  1420. * fix(populate): handle empty virtual populate with Model.populate #5331
  1421. * fix(model): make ensureIndexes() run with autoIndex: false unless called internally #5328 #5324 #5317
  1422. * fix: wait for all connections to close before resolving disconnect() promise #5316
  1423. * fix(document): handle setting populated path with custom typeKey in schema #5313
  1424. * fix(error): add toJSON helper to ValidationError so `message` shows up with JSON.stringify #5309
  1425. * feat: add `getPromiseConstructor()` to prevent need for `mongoose.Promise.ES6` #5305
  1426. * fix(document): handle conditional required with undefined props #5296
  1427. * fix(model): clone options before inserting in save() #5294
  1428. * docs(populate): clarify that multiple populate() calls on same path overwrite #5274
  1429. 4.10.5 / 2017-06-06
  1430. ===================
  1431. * chore: improve contrib guide for building docs #5312
  1432. * fix(populate): handle init-ing nested virtuals properly #5311
  1433. * fix(update): report update validator error if required path under single nested doc not set
  1434. * fix(schema): remove default validate pre hook that was causing issues with jest #4943
  1435. 4.10.4 / 2017-05-29
  1436. ===================
  1437. * chore: dont store test data in same directory #5303
  1438. * chore: add data dirs to npmignore #5301 [Starfox64](https://github.com/Starfox64)
  1439. * docs(query): add docs about runSettersOnQuery #5300
  1440. 4.10.3 / 2017-05-27
  1441. ===================
  1442. * docs: correct inconsistent references to updateOne and replaceOne #5297 [dhritzkiv](https://github.com/dhritzkiv)
  1443. * docs: fix dropdowns in docs #5292 [nathanallen](https://github.com/nathanallen)
  1444. * docs: add description of alias option #5287
  1445. * fix(document): prevent infinite loop if validating nested array #5282
  1446. * fix(schema): correctly handle ref ObjectIds from different mongoose libs #5259
  1447. * fix(schema): load child class methods after base class methods to allow override #5227
  1448. 4.10.2 / 2017-05-22
  1449. ===================
  1450. * fix: bump ms -> 2.0.0 and mquery -> 2.3.1 for minor security vulnerability #5275
  1451. 4.10.1 / 2017-05-21
  1452. ===================
  1453. * fix(aggregate): handle sorting by text score correctly #5258
  1454. * fix(populate): handle doc.populate() with virtuals #5240
  1455. * fix(schema): enforce that `_id` is never null #5236
  1456. 4.10.0 / 2017-05-18
  1457. ===================
  1458. * fix(schema): update clone method to include indexes #5268 [clozanosanchez](https://github.com/clozanosanchez)
  1459. * feat(schema): support aliases #5184 [rocketspacer](https://github.com/rocketspacer)
  1460. * feat(aggregate): add mongoose-specific aggregation cursor option #5145
  1461. * refactor(model): make sharding into a plugin instead of core #5105
  1462. * fix(document): make nested doc mongoose internals not enumerable again #5078
  1463. * feat(model): pass params to pre hooks #5064
  1464. * feat(timestamps): support already defined timestamp paths in schema #4868
  1465. * feat(query): add runSettersOnQuery option #4569
  1466. * fix(query): add strictQuery option that throws when not querying on field not in schema #4136
  1467. * fix(update): more complete handling for overwrite option with update validators #3556
  1468. * feat: support `unique: true` in arrays via the mongoose-unique-array plugin #3347
  1469. * fix(model): always emit 'index', even if no indexes #3347
  1470. * fix(schema): set unique indexes on primitive arrays #3347
  1471. * feat(validation): include failed paths in error message and inspect output #3064 #2135
  1472. * fix(model): return saved docs when create() fails #2190
  1473. 4.9.10 / 2017-05-17
  1474. ===================
  1475. * fix(connection): ensure callback arg to openSet() is handled properly #5249
  1476. * docs: remove dead plugins repo and add content links #5247
  1477. * fix(model): skip index build if connecting after model init and autoIndex false #5176
  1478. 4.9.9 / 2017-05-13
  1479. ==================
  1480. * docs: correct value for Query#regex() #5230
  1481. * fix(connection): don't throw if .catch() on open() promise #5229
  1482. * fix(schema): allow update with $currentDate for updatedAt to succeed #5222
  1483. * fix(model): versioning doesn't fail if version key undefined #5221 [basileos](https://github.com/basileos)
  1484. * fix(document): don't emit model error if callback specified for consistency with docs #5216
  1485. * fix(document): handle errors in subdoc pre validate #5215
  1486. 4.9.8 / 2017-05-07
  1487. ==================
  1488. * docs(subdocs): rewrite subdocs guide #5217
  1489. * fix(document): avoid circular JSON if error in doc array under single nested subdoc #5208
  1490. * fix(document): set intermediate empty objects for deeply nested undefined paths before path itself #5206
  1491. * fix(schema): throw error if first param to schema.plugin() is not a function #5201
  1492. * perf(document): major speedup in validating subdocs (50x in some cases) #5191
  1493. 4.9.7 / 2017-04-30
  1494. ==================
  1495. * docs: fix typo #5204 [phutchins](https://github.com/phutchins)
  1496. * fix(schema): ensure correct path for deeply nested schema indexes #5199
  1497. * fix(schema): make remove a reserved name #5197
  1498. * fix(model): handle Decimal type in insertMany correctly #5190
  1499. * fix: upgrade kareem to handle async pre hooks correctly #5188
  1500. * docs: add details about unique not being a validator #5179
  1501. * fix(validation): handle returning a promise with isAsync: true #5171
  1502. 4.9.6 / 2017-04-23
  1503. ==================
  1504. * fix: update `parentArray` references when directly assigning document arrays #5192 [jhob](https://github.com/jhob)
  1505. * docs: improve schematype validator docs #5178 [milesbarr](https://github.com/milesbarr)
  1506. * fix(model): modify discriminator() class in place #5175
  1507. * fix(model): handle bulkWrite updateMany casting #5172 [tzellman](https://github.com/tzellman)
  1508. * docs(model): fix replaceOne example for bulkWrite #5168
  1509. * fix(document): don't create a new array subdoc when creating schema array #5162
  1510. * fix(model): merge query hooks from discriminators #5147
  1511. * fix(document): add parent() function to subdocument to match array subdoc #5134
  1512. 4.9.5 / 2017-04-16
  1513. ==================
  1514. * fix(query): correct $pullAll casting of null #5164 [Sebmaster](https://github.com/Sebmaster)
  1515. * docs: add advanced schemas docs for loadClass #5157
  1516. * fix(document): handle null/undefined gracefully in applyGetters() #5143
  1517. * fix(model): add resolveToObject option for mapReduce with ES6 promises #4945
  1518. 4.9.4 / 2017-04-09
  1519. ==================
  1520. * fix(schema): clone query middleware correctly #5153 #5141 [clozanosanchez](https://github.com/clozanosanchez)
  1521. * docs(aggregate): fix typo #5142
  1522. * fix(query): cast .$ update to underlying array type #5130
  1523. * fix(populate): don't mutate populate result in place #5128
  1524. * fix(query): handle $setOnInsert consistent with $set #5126
  1525. * docs(query): add strict mode option for findOneAndUpdate #5108
  1526. 4.9.3 / 2017-04-02
  1527. ==================
  1528. * docs: document.js fixes for functions prepended with `$` #5131 [krmannix](https://github.com/krmannix)
  1529. * fix: Avoid exception on constructor check #5129 [monkbroc](https://github.com/monkbroc)
  1530. * docs(schematype): explain how to use `isAsync` with validate() #5125
  1531. * docs(schematype): explain custom message with required function #5123
  1532. * fix(populate): only apply refPath duplicate id optimization if not array #5114
  1533. * fix(document): copy non-objects to doc when init() #5111
  1534. * perf(populate): dont clone whole options every time #5103
  1535. * feat(document): add isDirectSelected() to minimize isSelected() changes #5063
  1536. * docs(schematypes): explain some subtleties with arrays #5059
  1537. 4.9.2 / 2017-03-26
  1538. ==================
  1539. * fix(discriminator): handle class names consistently #5104
  1540. * fix(schema): make clone() work with reusing discriminator schemas #5098
  1541. * fix(querycursor): run pre find hooks with .cursor() #5096
  1542. * fix(connection): throw error if username:password includes @ or : #5091
  1543. * fix(timestamps): handle overwriting createdAt+updatedAt consistently #5088
  1544. * fix(document): ensure subdoc post save runs after parent save #5085
  1545. * docs(model): improve update docs #5076 [bertolo1988](https://github.com/bertolo1988)
  1546. 4.9.1 / 2017-03-19
  1547. ==================
  1548. * fix(query): handle $type for arrays #5080 #5079 [zoellner](https://github.com/zoellner)
  1549. * fix(model): handle ordered param for `insertMany` validation errors #5072 [sjorssnoeren](https://github.com/sjorssnoeren)
  1550. * fix(populate): avoid duplicate ids in dynref queries #5054
  1551. * fix(timestamps): dont set timestamps in update if user set it #5045
  1552. * fix(update): dont double-call setters on arrays #5041
  1553. * fix: upgrade driver -> 2.2.25 for jest fix #5033
  1554. * fix(model): get promise each time save() is called rather than once #5030
  1555. * fix(connection): make connect return value consistent #5006
  1556. 4.9.0 / 2017-03-13
  1557. ==================
  1558. * feat(document): return this from `depopulate()` #5027
  1559. * fix(drivers): stop emitting timeouts as errors #5026
  1560. * feat(schema): add a clone() function for schemas #4983
  1561. * feat(query): add rawResult option to replace passRawResult, deprecate passRawResult #4977 #4925
  1562. * feat(schematype): support isAsync validator option and handle returning promises from validators, deprecate implicit async validators #4290
  1563. * feat(query): add `replaceOne()`, `deleteOne()`, `deleteMany()` #3998
  1564. * feat(model): add `bulkWrite()` #3998
  1565. 4.8.7 / 2017-03-12
  1566. ==================
  1567. * fix(model): if last arg in spread is falsy, treat it as a callback #5061
  1568. * fix(document): use $hook instead of hook to enable 'hook' as a path name #5047
  1569. * fix(populate): dont select foreign field if parent field is selected #5037
  1570. * fix(populate): handle passing no args to query.populate #5036
  1571. * fix(update): use correct method for casting nested arrays #5032
  1572. * fix(discriminator): handle array discriminators when casting $push #5009
  1573. 4.8.6 / 2017-03-05
  1574. ==================
  1575. * docs(document): remove text that implies that transform is false by default #5023
  1576. * fix(applyHooks): dont wrap a function if it is already wrapped #5019
  1577. * fix(document): ensure nested docs' toObject() clones #5008
  1578. 4.8.5 / 2017-02-25
  1579. ==================
  1580. * fix: check for empty schemaPath before accessing property $isMongooseDocumentArray #5017 [https://github.com/randyhoulahan](randyhoulahan)
  1581. * fix(discriminators): handle create() and push() for embedded discriminators #5001
  1582. * fix(querycursor): ensure close emitted after last data event #4998
  1583. * fix(discriminators): remove fields not selected in child when querying by base model #4991
  1584. 4.8.4 / 2017-02-19
  1585. ==================
  1586. * docs(discriminators): explain embedded discriminators #4997
  1587. * fix(query): fix TypeError when findOneAndUpdate errors #4990
  1588. * fix(update): handle nested single embedded in update validators correctly #4989
  1589. * fix(browser): make browser doc constructor not crash #4987
  1590. 4.8.3 / 2017-02-15
  1591. ==================
  1592. * chore: upgrade mongodb driver -> 2.2.24
  1593. * docs(connections): addd some details about callbacks #4986
  1594. * fix: ensure class is created with new keyword #4972 #4947 [benhjames](https://github.com/benhjames)
  1595. * fix(discriminator): add applyPluginsToDiscriminators option #4965
  1596. * fix(update): properly cast array subdocs when casting update #4960
  1597. * fix(populate): ensure foreign field is selected for virtual populate #4959
  1598. * docs(query): document some query callback params #4949
  1599. * fix(document): ensure errors in validators get caught #2185
  1600. 4.8.2 / 2017-02-10
  1601. ==================
  1602. * fix(update): actually run validators on addToSet #4953
  1603. * fix(update): improve buffer error handling #4944 [ValYouW](https://github.com/ValYouW)
  1604. * fix(discriminator): handle subclassing with loadClass correctly #4942
  1605. * fix(query): allow passing Map to sort() #4941
  1606. * fix(document): handle setting discriminator doc #4935
  1607. * fix(schema): return correct value from pre init hook #4928
  1608. * fix(query): ensure consistent params in error handlers if pre hook errors #4927
  1609. 4.8.1 / 2017-01-30
  1610. ==================
  1611. * fix(query): handle $exists for arrays and embedded docs #4937
  1612. * fix(query): handle passing string to hint() #4931
  1613. 4.8.0 / 2017-01-28
  1614. ==================
  1615. * feat(schema): add saveErrorIfNotFound option and $where property #4924 #4004
  1616. * feat(query): add $in implicitly if passed an array #4912 [QuotableWater7](https://github.com/QuotableWater7)
  1617. * feat(aggregate): helper for $facet #4904 [varunjayaraman](https://github.com/varunjayaraman)
  1618. * feat(query): add collation method #4839
  1619. * feat(schema): propogate strict option to implicit array subschemas #4831 [dkrosso](https://github.com/dkrosso)
  1620. * feat(aggregate): add helper for graphLookup #4819 [varunjayaraman](https://github.com/varunjayaraman)
  1621. * feat(types): support Decimal128 #4759
  1622. * feat(aggregate): add eachAsync() to aggregate cursor #4300
  1623. * feat(query): add updateOne and updateMany #3997
  1624. * feat(model): support options for insertMany #3893
  1625. * fix(document): run validation on single nested docs if not directly modified #3884
  1626. * feat(model): use discriminator constructor based on discriminatorKey in create() #3624
  1627. * feat: pass collection as context to debug function #3261
  1628. * feat(query): support push and addToSet for update validators #2933
  1629. * perf(document): refactor registerHooksFromSchema so hooks are defined on doc prototype #2754
  1630. * feat(types): add discriminator() function to doc arrays #2723 #1856
  1631. * fix(populate): return an error if sorting underneath a doc array #2202
  1632. 4.7.9 / 2017-01-27
  1633. ==================
  1634. * fix(query): handle casting $exists under $not #4933
  1635. * chore: upgrade mongodb -> 2.2.22 re: #4931
  1636. 4.7.8 / 2017-01-23
  1637. ==================
  1638. * fix(populate): better handling for virtual populate under arrays #4923
  1639. * docs: upgrade contributors count #4918 [AdamZaczek](https://github.com/AdamZaczek)
  1640. * fix(query): don't set nested path default if setting parent path #4911
  1641. * docs(promise): add missing bracket #4907
  1642. * fix(connection): ensure error handling is consistently async #4905
  1643. * fix: handle authMechanism in query string #4900
  1644. * fix(document): ensure error handlers run for validate #4885
  1645. 4.7.7 / 2017-01-15
  1646. ==================
  1647. * fix(utils): don't crash if to[key] is null #4881
  1648. * fix: upgrade mongodb -> 2.2.21 #4867
  1649. * fix: add a toBSON to documents for easier querying #4866
  1650. * fix: suppress bluebird warning #4854 [davidwu226](https://github.com/davidwu226)
  1651. * fix(populate): handle nested virtuals in virtual populate #4851
  1652. 4.7.6 / 2017-01-02
  1653. ==================
  1654. * fix(model): allow passing non-array to insertMany #4846
  1655. * fix(populate): use base model name if no discriminator for backwards compat #4843
  1656. * fix: allow internal validate callback to be optional #4842 [arciisine](https://github.com/arciisine)
  1657. * fix(document): don't skip pointCut if save not defined (like in browser doc) #4841
  1658. * chore: improve benchmarks #4838 [billouboq](https://github.com/billouboq)
  1659. * perf: remove some unused parameters #4837 [billouboq](https://github.com/billouboq)
  1660. * fix(query): don't call error handler if passRawResult is true and no error occurred #4836
  1661. 4.7.5 / 2016-12-26
  1662. ==================
  1663. * docs(model): fix spelling mistake #4828 [paulinoj](https://github.com/paulinoj)
  1664. * fix(aggregate): remove unhandled rejection when using aggregate.then() #4824
  1665. * perf: remove try/catch that kills optimizer #4821
  1666. * fix(model): handles populating with discriminators that may not have a ref #4817
  1667. * fix(document): handle setting array of discriminators #3575
  1668. 4.7.4 / 2016-12-21
  1669. ==================
  1670. * docs: fix typo #4810 [GEEKIAM](https://github.com/GEEKIAM)
  1671. * fix(query): timestamps with $push + $each #4805
  1672. * fix(document): handle buffers correctly in minimize #4800
  1673. * fix: don't disallow overwriting default and cast fns #4795 [pdspicer](https://github.com/pdspicer)
  1674. * fix(document): don't convert single nested docs to POJOs #4793
  1675. * fix(connection): handle reconnect to replica set correctly #4972 [gfzabarino](https://github.com/gfzabarino)
  1676. 4.7.3 / 2016-12-16
  1677. ==================
  1678. * fix: upgrade mongodb driver -> 2.2.16 for several bug fixes and 3.4 support #4799
  1679. * fix(model): ensure discriminator key is correct for child schema on discriminator #4790
  1680. * fix(document): handle mark valid in subdocs correctly #4778
  1681. * fix(query): check for objects consistently #4775
  1682. 4.7.2 / 2016-12-07
  1683. ==================
  1684. * test(populate): fix justOne test #4772 [cblanc](https://github.com/cblanc)
  1685. * chore: fix benchmarks #4769 [billouboq](https://github.com/billouboq)
  1686. * fix(document): handle setting subdoc to null after setting parent doc #4766
  1687. * fix(query): support passRawResult with lean #4762 #4761 [mhfrantz](https://github.com/mhfrantz)
  1688. * fix(query): throw StrictModeError if upsert with nonexisting field in condition #4757
  1689. * test: fix a couple of sort tests #4756 [japod](https://github.com/japod)
  1690. * chore: upgrade mongodb driver -> 2.2.12 #4753 [mdlavin](https://github.com/mdlavin)
  1691. * fix(query): handle update with upsert and overwrite correctly #4749
  1692. 4.7.1 / 2016-11-30
  1693. ==================
  1694. * fix(schema): throw error if you use prototype as a schema path #4746
  1695. * fix(schema): throw helpful error if you define a virtual with the same path as a real path #4744
  1696. * fix(connection): make createConnection not throw rejected promises #4742
  1697. * fix(populate): allow specifiying options in model schema #4741
  1698. * fix(document): handle selected nested elements with defaults #4739
  1699. * fix(query): add model to cast error if possible #4729
  1700. * fix(query): handle timestamps with overwrite #4054
  1701. 4.7.0 / 2016-11-23
  1702. ==================
  1703. * docs: clean up schematypes #4732 [kidlj](https://github.com/kidlj)
  1704. * perf: only get stack when necessary with VersionError #4726 [Sebmaster](https://github.com/Sebmaster)
  1705. * fix(query): ensure correct casting when setting array element #4724
  1706. * fix(connection): ensure db name gets set when you pass 4 params #4721
  1707. * fix: prevent TypeError in node v7 #4719 #4706
  1708. * feat(document): support .set() on virtual subpaths #4716
  1709. * feat(populate): support populate virtuals on nested schemas #4715
  1710. * feat(querycursor): support transform option and .map() #4714 #4705 [cblanc](https://github.com/cblanc)
  1711. * fix(document): dont set defaults on not-selected nested paths #4707
  1712. * fix(populate): don't throw if empty string passed to populate #4702
  1713. * feat(model): add `loadClass()` function for importing schema from ES6 class #4668 [rockmacaca](https://github.com/rockmacaca)
  1714. 4.6.8 / 2016-11-14
  1715. ==================
  1716. * fix(querycursor): clear stack when iterating onto next doc #4697
  1717. * fix: handle null keys in validation error #4693 #4689 [arciisine](https://github.com/arciisine)
  1718. * fix(populate): handle pre init middleware correctly with populate virtuals #4683
  1719. * fix(connection): ensure consistent return value for open and openSet #4659
  1720. * fix(schema): handle falsy defaults for arrays #4620
  1721. 4.6.7 / 2016-11-10
  1722. ==================
  1723. * fix(document): only invalidate in subdoc if using update validators #4681
  1724. * fix(document): don't create subdocs when excluded in projection #4669
  1725. * fix(document): ensure single embedded schema validator runs with correct context #4663
  1726. * fix(document): make sure to depopulate top level for sharding #4658
  1727. * fix(connection): throw more helpful error when .model() called incorrectly #4652
  1728. * fix(populate): throw more descriptive error when trying to populate a virtual that doesn't have proper options #4602
  1729. * fix(document): ensure subtype gets set properly when saving with a buffer id #4506
  1730. * fix(query): handle setDefaultsOnInsert with defaults on doc arrays #4456
  1731. * fix(drivers): make debug output better by calling toBSON() #4356
  1732. 4.6.6 / 2016-11-03
  1733. ==================
  1734. * chore: upgrade deps #4674 [TrejGun](https://github.com/TrejGun)
  1735. * chore: run tests on node v7 #4673 [TrejGun](https://github.com/TrejGun)
  1736. * perf: make setDefaultsOnInsert more efficient if upsert is off #4672 [CamHenlin](https://github.com/CamHenlin)
  1737. * fix(populate): ensure document array is returned #4656
  1738. * fix(query): cast doc arrays with positionals correctly for update #4655
  1739. * fix(document): ensure single nested doc validators run with correct context #4654
  1740. * fix: handle reconnect failed error in new version of driver #4653 [loris](https://github.com/loris)
  1741. * fix(populate): if setting a populated doc, take its id #4632
  1742. * fix(populate): handle populated virtuals in init #4618
  1743. 4.6.5 / 2016-10-23
  1744. ==================
  1745. * docs: fix grammar issues #4642 #4640 #4639 [silvermanj7](https://github.com/silvermanj7)
  1746. * fix(populate): filter out nonexistant values for dynref #4637
  1747. * fix(query): handle $type as a schematype operator #4632
  1748. * fix(schema): better handling for uppercase: false and lowercase: false #4622
  1749. * fix(query): don't run transforms on updateForExec() #4621
  1750. * fix(query): handle id = 0 in findById #4610
  1751. * fix(query): handle buffers in mergeClone #4609
  1752. * fix(document): handle undefined with conditional validator for validateSync #4607
  1753. * fix: upgrade to mongodb driver 2.2.11 #4581
  1754. * docs(schematypes): clarify schema.path() #4518
  1755. * fix(query): ensure path is defined before checking in timestamps #4514
  1756. * fix(model): set version key in upsert #4505
  1757. * fix(document): never depopulate top-level doc #3057
  1758. * refactor: ensure sync for setting non-capped collections #2690
  1759. 4.6.4 / 2016-10-16
  1760. ==================
  1761. * fix(query): cast $not correctly #4616 #4592 [prssn](https://github.com/prssn)
  1762. * fix: address issue with caching global plugins #4608 #4601 [TrejGun](https://github.com/TrejGun)
  1763. * fix(model): make sure to depopulate in insertMany #4590
  1764. * fix(model): buffer autoIndex if bufferCommands disabled #4589
  1765. * fix(populate): copy ids array before modifying #4585
  1766. * feat(schema): add retainKeyOrder prop #4542
  1767. * fix(document): return isModified true for children of direct modified paths #4528
  1768. * fix(connection): add dropDatabase() helper #4490
  1769. * fix(model): add usePushEach option for schemas #4455
  1770. * docs(connections): add some warnings about buffering #4413
  1771. * fix: add ability to set promise implementation in browser #4395
  1772. 4.6.3 / 2016-10-05
  1773. ==================
  1774. * fix(document): ensure single nested docs get initialized correctly when setting nested paths #4578
  1775. * fix: turn off transforms when writing nested docs to db #4574
  1776. * fix(document): don't set single nested subdocs to null when removing parent doc #4566
  1777. * fix(model): ensure versionKey gets set in insertMany #4561
  1778. * fix(schema): handle typeKey in arrays #4548
  1779. * feat(schema): set $implicitlyCreated on schema if created by interpretAsType #4443
  1780. 4.6.2 / 2016-09-30
  1781. ==================
  1782. * chore: upgrade to async 2.0.1 internally #4579 [billouboq](https://github.com/billouboq)
  1783. * fix(types): ensure nested single doc schema errors reach update validators #4557 #4519
  1784. * fix(connection): handle rs names with leading numbers (muri 1.1.1) #4556
  1785. * fix(model): don't throw if method name conflicts with Object.prototype prop #4551
  1786. * docs: fix broken link #4544 [VFedyk](https://github.com/VFedyk)
  1787. * fix: allow overwriting model on mongoose singleton #4541 [Nainterceptor](https://github.com/Nainterceptor)
  1788. * fix(document): don't use init: true when building doc defaults #4540
  1789. * fix(connection): use replSet option if replset not specified #4535
  1790. * fix(query): cast $not objects #4495
  1791. 4.6.1 / 2016-09-20
  1792. ==================
  1793. * fix(query): improve handling of $not with $elemMatch #4531 #3719 [timbowhite](https://github.com/timbowhite)
  1794. * fix: upgrade mongodb -> 2.2.10 #4517
  1795. * chore: fix webpack build issue #4512 [saiichihashimoto](https://github.com/saiichihashimoto)
  1796. * fix(query): emit error on next tick when exec callback errors #4500
  1797. * test: improve test case #4496 [isayme](https://github.com/isayme)
  1798. * fix(schema): use same check for array types and top-level types #4493
  1799. * style: fix indentation in docs #4489 [dhurlburtusa](https://github.com/dhurlburtusa)
  1800. * fix(schema): expose original object passed to constructor #4486
  1801. * fix(query): handle findOneAndUpdate with array of arrays #4484 #4470 [fedotov](https://github.com/fedotov)
  1802. * feat(document): add $ignore to make a path ignored #4480
  1803. * fix(query): properly handle setting single embedded in update #4475 #4466 #4465
  1804. * fix(updateValidators): handle single nested schema subpaths correctly #4479
  1805. * fix(model): throw handy error when method name conflicts with property name #4475
  1806. * fix(schema): handle .set() with array field #4472
  1807. * fix(query): check nested path when avoiding double-validating Mixed #4441
  1808. * fix(schema): handle calling path.trim() with no args correctly #4042
  1809. 4.6.0 / 2016-09-02
  1810. ==================
  1811. * docs(document): clarify the findById and findByIdAndUpdate examples #4471 [mdcanham](https://github.com/mdcanham)
  1812. * docs(schematypes): add details re: options #4452
  1813. * docs(middleware): add docs for insertMany hooks #4451
  1814. * fix(schema): create new array when copying from existing object to preserve change tracking #4449
  1815. * docs: fix typo in index.jade #4448
  1816. * fix(query): allow array for populate options #4446
  1817. * fix(model): create should not cause unhandle reject promise #4439
  1818. * 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)
  1819. 4.5.10 / 2016-08-23
  1820. ===================
  1821. * docs: fix typo on documents.jade #4444 [Gabri3l](https://github.com/Gabri3l)
  1822. * chore: upgrade mocha to 3.0.2 #4437 [TrejGun](https://github.com/TrejGun)
  1823. * fix: subdocuments causing error with parent timestamp on update #4434 [dyang108](https://github.com/dyang108)
  1824. * fix(query): don't crash if timestamps on and update doesn't have a path #4425 #4424 #4418
  1825. * fix(query): ensure single nested subdoc is hydrated when running update validators #4420
  1826. * fix(query): cast non-$geometry operators for $geoWithin #4419
  1827. * docs: update contributor count #4415 [AdamZaczek](https://github.com/AdamZaczek)
  1828. * docs: add more clarification re: the index event #4410
  1829. * fix(document): only skip modifying subdoc path if parent is direct modified #4405
  1830. * fix(schema): throw cast error if provided date invalid #4404
  1831. * feat(error): use util.inspect() so CastError never prints "[object Object]" #4398
  1832. * fix(model): dont error if the discriminator key is unchanged #4387
  1833. * fix(query): don't throw unhandled rejection with bluebird when using cbs #4379
  1834. 4.5.9 / 2016-08-14
  1835. ==================
  1836. * docs: add mixed schema doc for Object literal #4400 [Kikobeats](https://github.com/Kikobeats)
  1837. * fix(query): cast $geoWithin and convert mongoose objects to POJOs before casting #4392
  1838. * fix(schematype): dont cast defaults without parent doc #4390
  1839. * fix(query): disallow passing empty string to findOne() #4378
  1840. * fix(document): set single nested doc isNew correctly #4369
  1841. * fix(types): checks field name correctly with nested arrays and populate #4365
  1842. * fix(drivers): make debug output copy-pastable into mongodb shell #4352
  1843. * fix(services): run update validators on nested paths #4332
  1844. * fix(model): handle typeKey with discriminators #4339
  1845. * fix(query): apply timestamps to child schemas when explicitly specified in update #4049
  1846. * fix(schema): set prefix as nested path with add() #1730
  1847. 4.5.8 / 2016-08-01
  1848. ==================
  1849. * fix(model): make changing the discriminator key cause a cast error #4374
  1850. * fix(query): pass projection fields to cursor #4371 #4342 [Corei13](https://github.com/Corei13)
  1851. * fix(document): support multiple paths for isModified #4370 [adambuczynski](https://github.com/adambuczynski)
  1852. * fix(querycursor): always cast fields before returning cursor #4355
  1853. * fix(query): support projection as alias for fields in findOneAndUpdate #4315
  1854. * fix(schema): treat index false + unique false as no index #4304
  1855. * fix(types): dont mark single nested subpath as modified if whole doc already modified #4224
  1856. 4.5.7 / 2016-07-25
  1857. ==================
  1858. * fix(document): ensure no unhandled rejections if callback specified for save #4364
  1859. 4.5.6 / 2016-07-23
  1860. ==================
  1861. * fix(schema): don't overwrite createdAt if it isn't selected #4351 [tusbar](https://github.com/tusbar)
  1862. * docs(api): fix link to populate() and add a new one from depopulate() #4345 [Delapouite](https://github.com/Delapouite)
  1863. * fix(types): ownerDocument() works properly with single nested docs #4344 [vichle](https://github.com/vichle)
  1864. * fix(populate): dont use findOne when justOne option set #4329
  1865. * fix(document): dont trigger .then() deprecated warning when calling doc.remove() #4291
  1866. * docs(connection): add promiseLibrary option #4280
  1867. * fix(plugins): apply global plugins to subschemas #4271
  1868. * fix(model): ensure `ensureIndex()` never calls back in the same tick #4246
  1869. * docs(schema): improve post hook docs on schema #4238
  1870. 4.5.5 / 2016-07-18
  1871. ==================
  1872. * fix(document): handle setting root to empty obj if minimize false #4337
  1873. * fix: downgrade to mongodb 2.1.18 #4335 #4334 #4328 #4323
  1874. * perf(types): remove defineProperty usage in documentarray #4333
  1875. * fix(query): correctly pass model in .toConstructor() #4318
  1876. * fix(services): avoid double-validating mixed types with update validators #4305
  1877. * docs(middleware): add docs describing error handling middleware #4229
  1878. * fix(types): throw correct error when invalidating doc array #3602
  1879. 4.5.4 / 2016-07-11
  1880. ==================
  1881. * fix(types): fix removing embedded documents #4309 [RoCat](https://github.com/RoCat)
  1882. * docs: various docs improvements #4302 #4294 [simonxca](https://github.com/simonxca)
  1883. * fix: upgrade mongodb -> 2.1.21 #4295 #4202 [RoCat](https://github.com/RoCat)
  1884. * fix(populate): convert single result to array for virtual populate because of lean #4288
  1885. * fix(populate): handle empty results for populate virtuals properly #4285 #4284
  1886. * fix(query): dont cast $inc to number if type is long #4283
  1887. * fix(types): allow setting single nested doc to null #4281
  1888. * fix(populate): handle deeply nested virtual populate #4278
  1889. * fix(document): allow setting empty obj if strict mode is false #4274
  1890. * fix(aggregate): allow passing obj to .unwind() #4239
  1891. * docs(document): add return statements to transform examples #1963
  1892. 4.5.3 / 2016-06-30
  1893. ==================
  1894. * fix(query): pass correct options to QueryCursor #4277 #4266
  1895. * fix(querycursor): handle lean option correctly #4276 [gchudnov](https://github.com/gchudnov)
  1896. * fix(document): fix error handling when no error occurred #4275
  1897. * fix(error): use strict mode for version error #4272
  1898. * docs(populate): fix crashing compilation for populate.jade #4267
  1899. * fix(populate): support `justOne` option for populate virtuals #4263
  1900. * fix(populate): ensure model param gets used for populate virtuals #4261 #4243
  1901. * fix(querycursor): add ability to properly close the cursor #4258
  1902. * docs(model): correct link to Document #4250
  1903. * docs(populate): correct path for refPath populate #4240
  1904. * fix(document): support validator.isEmail as validator #4064
  1905. 4.5.2 / 2016-06-24
  1906. ==================
  1907. * fix(connection): add checks for collection presence for `onOpen` and `onClose` #4259 [nodkz](https://github.com/nodkz)
  1908. * fix(cast): allow strings for $type operator #4256
  1909. * fix(querycursor): support lean() #4255 [pyramation](https://github.com/pyramation)
  1910. * fix(aggregate): allow setting noCursorTimeout option #4241
  1911. * fix(document): handle undefined for Array.pull #4222 [Sebmaster](https://github.com/Sebmaster)
  1912. * fix(connection): ensure promise.catch() catches initial connection error #4135
  1913. * fix(document): show additional context for VersionError #2633
  1914. 4.5.1 / 2016-06-18
  1915. ==================
  1916. * fix(model): ensure wrapped insertMany() returns a promise #4237
  1917. * fix(populate): dont overwrite populateVirtuals when populating multiple paths #4234
  1918. * docs(model): clarify relationship between create() and save() #4233
  1919. * fix(types): handle option param in subdoc remove() #4231 [tdebarochez](https://github.com/tdebarochez)
  1920. * fix(document): dedupe modified paths #4226 #4223 [adambuczynski](https://github.com/adambuczynski)
  1921. * fix(model): don't modify user-provided options object #4221
  1922. * fix(document): handle setting nested path to empty object #4218 #4182
  1923. * fix(document): clean subpaths when removing single nested #4216
  1924. * fix(document): don't force transform on subdocs with inspect #4213
  1925. * fix(error): allow setting .messages object #4207
  1926. 4.5.0 / 2016-06-13
  1927. ==================
  1928. * feat(query): added Query.prototype.catch() #4215 #4173 [adambuczynski](https://github.com/adambuczynski)
  1929. * feat(query): add Query.prototype.cursor() as a .stream() alternative #4117 #3637 #1907
  1930. * feat(document): add markUnmodified() function #4092 [vincentcr](https://github.com/vincentcr)
  1931. * feat(aggregate): convert aggregate object to a thenable #3995 #3946 [megagon](https://github.com/megagon)
  1932. * 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
  1933. * feat(model): add hooks for insertMany() #3846
  1934. * feat(schema): add support for custom query methods #3740 #2372
  1935. * feat(drivers): emit error on 'serverClosed' because that means that reconnect failed #3615
  1936. * feat(model): emit error event when callback throws exception #3499
  1937. * feat(model): inherit options from discriminator base schema #3414 #1818
  1938. * feat(populate): expose mongoose-populate-virtuals inspired populate API #2562
  1939. * feat(document): trigger remove hooks on subdocs when removing parent #2348
  1940. * feat(schema): add support for express-style error handling middleware #2284
  1941. * fix(model): disallow setting discriminator key #2041
  1942. * feat(schema): add support for nested arrays #1361
  1943. 4.4.20 / 2016-06-05
  1944. ===================
  1945. * docs: clarify command buffering when using driver directly #4195
  1946. * fix(promise): correct broken mpromise .catch() #4189
  1947. * fix(document): clean modified subpaths when set path to empty obj #4182
  1948. * fix(query): support minDistance with query casting and `.near()` #4179
  1949. * fix(model): remove unnecessary .save() promise #4177
  1950. * fix(schema): cast all valid ObjectId strings to object ids #3365
  1951. * docs: remove unclear "unsafe" term in query docs #3282
  1952. 4.4.19 / 2016-05-21
  1953. ===================
  1954. * fix(model): handle insertMany if timestamps not set #4171
  1955. 4.4.18 / 2016-05-21
  1956. ===================
  1957. * docs: add missing period #4170 [gitname](https://github.com/gitname)
  1958. * docs: change build badge to svg #4158 [a0viedo](https://github.com/a0viedo)
  1959. * fix(model): update timestamps when setting `createdAt` #4155
  1960. * fix(utils): make sure to require in document properly #4152
  1961. * fix(model): throw overwrite error when discriminator name conflicts #4148
  1962. 4.4.17 / 2016-05-13
  1963. ===================
  1964. * docs: remove repetition in QueryStream docs #4147 [hugoabonizio](https://github.com/hugoabonizio)
  1965. * fix(document): dont double-validate doc array elements #4145
  1966. * fix(document): call required function with correct scope #4142 [JedWatson](https://github.com/JedWatson)
  1967. 4.4.16 / 2016-05-09
  1968. ===================
  1969. * refactor(document): use function reference #4133 [dciccale](https://github.com/dciccale)
  1970. * docs(querystream): clarify `destroy()` and close event #4126 [AnthonyCC](https://github.com/AnthonyCC)
  1971. * test: make before hook fail fast if it can't connect #4121
  1972. * docs: add description of CastError constructor params #4120
  1973. * fix(schematype): ensure single embedded defaults have $parent #4115
  1974. * fix(document): mark nested paths for validation #4111
  1975. * fix(schema): make sure element is always a subdoc in doc array validation #3816
  1976. 4.4.15 / 2016-05-06
  1977. ===================
  1978. * fix(schema): support overwriting array default #4109
  1979. * fix(populate): assign values when resolving each populate #4104
  1980. * fix(aggregate): dont send async option to server #4101
  1981. * fix(model): ensure isNew set to false after insertMany #4099
  1982. * fix(connection): emit on error if listeners and no callback #4098
  1983. * fix(document): treat required fn that returns false as required: false #4094
  1984. 4.4.14 / 2016-04-27
  1985. ===================
  1986. * fix: upgrade mongodb -> 2.1.18 #4102
  1987. * feat(connection): allow setting mongos as a uri query param #4093 #4035 [burtonjc](https://github.com/burtonjc)
  1988. * fix(populate): make sure to use correct assignment order for each model #4073
  1989. * fix(schema): add complete set of geospatial operators for single embedded subdocs #4014
  1990. 3.8.40 / 2016-04-24
  1991. ===================
  1992. * upgraded; mquery -> 1.10.0 #3989
  1993. 4.4.13 / 2016-04-21
  1994. ===================
  1995. * docs: add docs favicons #4082 [robertjustjones](https://github.com/robertjustjones)
  1996. * docs(model): correct Model.remove() return value #4075 [Jokero](https://github.com/Jokero)
  1997. * fix(query): add $geoWithin query casting for single embedded docs #4044
  1998. * fix(schema): handle setting trim option to falsy #4042
  1999. * fix(query): handle setDefaultsOnInsert with empty update #3835
  2000. 4.4.12 / 2016-04-08
  2001. ===================
  2002. * docs(query): document context option for update and findOneAndUpdate #4055
  2003. * docs(query): correct link to $geoWithin docs #4050
  2004. * fix(project): upgrade to mongodb driver 2.1.16 #4048 [schmalliso](https://github.com/schmalliso)
  2005. * docs(validation): fix validation docs #4028
  2006. * fix(types): improve .id() check for document arrays #4011
  2007. * fix(query): remove premature return when using $rename #3171
  2008. * docs(connection): clarify relationship between models and connections #2157
  2009. 4.4.11 / 2016-04-03
  2010. ===================
  2011. * fix: upgrade to mongodb driver 2.1.14 #4036 #4030 #3945
  2012. * fix(connection): allow connecting with { mongos: true } to handle query params #4032 [burtonjc](https://github.com/burtonjc)
  2013. * docs(connection): add autoIndex example #4026 [tilleps](https://github.com/tilleps)
  2014. * fix(query): handle passRawResult option when zero results #4023
  2015. * fix(populate): clone options before modifying #4022
  2016. * docs: add missing whitespace #4019 [chenxsan](https://github.com/chenxsan)
  2017. * chore: upgrade to ESLint 2.4.0 #4015 [ChristianMurphy](https://github.com/ChristianMurphy)
  2018. * fix(types): single nested subdocs get ids by default #4008
  2019. * chore(project): add dependency status badge #4007 [Maheshkumar-Kakade](http://github.com/Maheshkumar-Kakade)
  2020. * fix: make sure timestamps don't trigger unnecessary updates #4005 #3991 [tommarien](https://github.com/tommarien)
  2021. * fix(document): inspect inherits schema options #4001
  2022. * fix(populate): don't mark populated path as modified if setting to object w/ same id #3992
  2023. * fix(document): support kind argument to invalidate #3965
  2024. 4.4.10 / 2016-03-24
  2025. ===================
  2026. * fix(document): copy isNew when copying a document #3982
  2027. * fix(document): don't override defaults with undefined keys #3981
  2028. * fix(populate): merge multiple deep populate options for the same path #3974
  2029. 4.4.9 / 2016-03-22
  2030. ==================
  2031. * fix: upgrade mongodb -> 2.1.10 re https://jira.mongodb.org/browse/NODE-679 #4010
  2032. * docs: add syntax highlighting for acquit examples #3975
  2033. 4.4.8 / 2016-03-18
  2034. ==================
  2035. * docs(aggregate): clarify promises #3990 [megagon](https://github.com/megagon)
  2036. * fix: upgrade mquery -> 1.10 #3988 [matskiv](https://github.com/matskiv)
  2037. * feat(connection): 'all' event for repl sets #3986 [xizhibei](https://github.com/xizhibei)
  2038. * docs(types): clarify Array.pull #3985 [seriousManual](https://github.com/seriousManual)
  2039. * feat(query): support array syntax for .sort() via mquery 1.9 #3980
  2040. * fix(populate): support > 3 level nested populate #3973
  2041. * fix: MongooseThenable exposes connection correctly #3972
  2042. * docs(connection): add note about reconnectTries and reconnectInterval #3969
  2043. * feat(document): invalidate returns the new validationError #3964
  2044. * fix(query): .eq() as shorthand for .equals #3953 [Fonger](https://github.com/Fonger)
  2045. * docs(connection): clarify connection string vs passed options #3941
  2046. * docs(query): select option for findOneAndUpdate #3933
  2047. * fix(error): ValidationError.properties no longer enumerable #3925
  2048. * docs(validation): clarify how required validators work with nested schemas #3915
  2049. * fix: upgrade mongodb driver -> 2.1.8 to make partial index errors more sane #3864
  2050. 4.4.7 / 2016-03-11
  2051. ==================
  2052. * fix(query): stop infinite recursion caused by merging a mongoose buffer #3961
  2053. * fix(populate): handle deep populate array -> array #3954
  2054. * fix(schema): allow setting timestamps with .set() #3952 #3951 #3907 [Fonger](https://github.com/Fonger)
  2055. * fix: MongooseThenable doesn't overwrite constructors #3940
  2056. * fix(schema): don't cast boolean to date #3935
  2057. * fix(drivers): support sslValidate in connection string #3929
  2058. * fix(types): correct markModified() for single nested subdocs #3910
  2059. * fix(drivers): catch and report any errors that occur in driver methods #3906
  2060. * fix(populate): get subpopulate model correctly when array under nested #3904
  2061. * fix(document): allow fields named 'pre' and 'post' #3902
  2062. * docs(query): clarify runValidators and setDefaultsOnInsert options #3892
  2063. * docs(validation): show how to use custom required messages in schema #2616
  2064. 4.4.6 / 2016-03-02
  2065. ==================
  2066. * fix: upgrade mongodb driver to 2.1.7 #3938
  2067. * docs: fix plugins link #3917 #3909 [fbertone](https://github.com/fbertone)
  2068. * fix(query): sort+select with count works #3914
  2069. * fix(query): improve mergeUpdate's ability to handle nested docs #3890
  2070. 4.4.5 / 2016-02-24
  2071. ==================
  2072. * fix(query): ability to select a length field (upgrade to mquery 1.7.0) #3903
  2073. * fix: include nested CastError as reason for array CastError #3897 [kotarou3](https://github.com/kotarou3)
  2074. * fix(schema): check for doc existence before taking fields #3889
  2075. * feat(schema): useNestedStrict option to take nested strict mode for update #3883
  2076. * docs(validation): clarify relationship between required and checkRequired #3822
  2077. * docs(populate): dynamic reference docs #3809
  2078. * docs: expand dropdown when clicking on file name #3807
  2079. * docs: plugins.mongoosejs.io is up #3127
  2080. * fix(schema): ability to add a virtual with same name as removed path #2398
  2081. 4.4.4 / 2016-02-17
  2082. ==================
  2083. * fix(schema): handle field selection when casting single nested subdocs #3880
  2084. * fix(populate): populating using base model with multiple child models in result #3878
  2085. * fix: ability to properly use return value of `mongoose.connect()` #3874
  2086. * fix(populate): dont hydrate populated subdoc if lean option set #3873
  2087. * fix(connection): dont re-auth if already connected with useDb #3871
  2088. * docs: cover how to set underlying driver's promise lib #3869
  2089. * fix(document): handle conflicting names in validation errors with subdocs #3867
  2090. * fix(populate): set undefined instead of null consistently when populate couldn't find results #3859
  2091. * docs: link to `execPopulate()` in `doc.populate()` docs #3836
  2092. * docs(plugin): link to the `mongoose.plugin()` function #3732
  2093. 4.4.3 / 2016-02-09
  2094. ==================
  2095. * fix: upgrade to mongodb 2.1.6 to remove kerberos log output #3861 #3860 [cartuchogl](https://github.com/cartuchogl)
  2096. * fix: require('mongoose') is no longer a pseudo-promise #3856
  2097. * fix(query): update casting for single nested docs #3820
  2098. * fix(populate): deep populating multiple paths with same options #3808
  2099. * docs(middleware): clarify save/validate hook order #1149
  2100. 4.4.2 / 2016-02-05
  2101. ==================
  2102. * fix(aggregate): handle calling .cursor() with no options #3855
  2103. * fix: upgrade mongodb driver to 2.1.5 for GridFS memory leak fix #3854
  2104. * docs: fix schematype.html conflict #3853 #3850 #3843
  2105. * fix(model): bluebird unhandled rejection with ensureIndexes() on init #3837
  2106. * docs: autoIndex option for createConnection #3805
  2107. 4.4.1 / 2016-02-03
  2108. ==================
  2109. * fix: linting broke some cases where we use `== null` as shorthand #3852
  2110. * docs: fix up schematype.html conflict #3848 #3843 [mynameiscoffey](https://github.com/mynameiscoffey)
  2111. * fix: backwards breaking change with `.connect()` return value #3847
  2112. * docs: downgrade dox and highlight.js to fix docs build #3845
  2113. * docs: clean up typo #3842 [Flash-](https://github.com/Flash-)
  2114. * fix(document): storeShard handles undefined values #3841
  2115. * chore: more linting #3838 [TrejGun](https://github.com/TrejGun)
  2116. * fix(schema): handle `text: true` as a way to declare a text index #3824
  2117. 4.4.0 / 2016-02-02
  2118. ==================
  2119. * docs: fix expireAfterSeconds index option name #3831 [Flash-](https://github.com/Flash-)
  2120. * chore: run lint after test #3829 [ChristianMurphy](https://github.com/ChristianMurphy)
  2121. * chore: use power-assert instead of assert #3828 [TrejGun](https://github.com/TrejGun)
  2122. * chore: stricter lint #3827 [TrejGun](https://github.com/TrejGun)
  2123. * feat(types): casting moment to date #3813 [TrejGun](https://github.com/TrejGun)
  2124. * chore: comma-last lint for test folder #3810 [ChristianMurphy](https://github.com/ChristianMurphy)
  2125. * fix: upgrade async mpath, mpromise, muri, and sliced #3801 [TrejGun](https://github.com/TrejGun)
  2126. * fix(query): geo queries now return proper ES2015 promises #3800 [TrejGun](https://github.com/TrejGun)
  2127. * perf(types): use `Object.defineProperties()` for array #3799 [TrejGun](https://github.com/TrejGun)
  2128. * fix(model): mapReduce, ensureIndexes, remove, and save properly return ES2015 promises #3795 #3628 #3595 [TrejGun](https://github.com/TrejGun)
  2129. * docs: fixed dates in History.md #3791 [Jokero](https://github.com/Jokero)
  2130. * feat: connect, open, openSet, and disconnect return ES2015 promises #3790 #3622 [TrejGun](https://github.com/TrejGun)
  2131. * feat: custom type for int32 via mongoose-int32 npm package #3652 #3102
  2132. * feat: basic custom schema type API #995
  2133. * feat(model): `insertMany()` for more performant bulk inserts #723
  2134. 4.3.7 / 2016-01-23
  2135. ==================
  2136. * docs: grammar fix in timestamps docs #3786 [zclancy](https://github.com/zclancy)
  2137. * fix(document): setting nested populated docs #3783 [slamuu](https://github.com/slamuu)
  2138. * fix(document): don't call post save hooks twice for pushed docs #3780
  2139. * fix(model): handle `_id=0` correctly #3776
  2140. * docs(middleware): async post hooks #3770
  2141. * docs: remove confusing sentence #3765 [marcusmellis89](https://github.com/marcusmellis89)
  2142. 3.8.39 / 2016-01-15
  2143. ===================
  2144. * fixed; casting a number to a buffer #3764
  2145. * fixed; enumerating virtual property with nested objects #3743 [kusold](https://github.com/kusold)
  2146. 4.3.6 / 2016-01-15
  2147. ==================
  2148. * fix(types): casting a number to a buffer #3764
  2149. * fix: add "listener" to reserved keywords #3759
  2150. * chore: upgrade uglify #3757 [ChristianMurphy](https://github.com/ChristianMurphy)
  2151. * fix: broken execPopulate() in 4.3.5 #3755 #3753
  2152. * fix: ability to remove() a single embedded doc #3754
  2153. * style: comma-last in test folder #3751 [ChristianMurphy](https://github.com/ChristianMurphy)
  2154. * docs: clarify versionKey option #3747
  2155. * fix: improve colorization for arrays #3744 [TrejGun](https://github.com/TrejGun)
  2156. * fix: webpack build #3713
  2157. 4.3.5 / 2016-01-09
  2158. ==================
  2159. * fix(query): throw when 4th parameter to update not a function #3741 [kasselTrankos](https://github.com/kasselTrankos)
  2160. * fix(document): separate error type for setting an object to a primitive #3735
  2161. * fix(populate): Model.populate returns ES6 promise #3734
  2162. * fix(drivers): re-register event handlers after manual reconnect #3729
  2163. * docs: broken links #3727
  2164. * fix(validation): update validators run array validation #3724
  2165. * docs: clarify the need to use markModified with in-place date ops #3722
  2166. * fix(document): mark correct path as populated when manually populating array #3721
  2167. * fix(aggregate): support for array pipeline argument to append #3718 [dbkup](https://github.com/dbkup)
  2168. * docs: clarify `.connect()` callback #3705
  2169. * fix(schema): properly validate nested single nested docs #3702
  2170. * fix(types): handle setting documentarray of wrong type #3701
  2171. * docs: broken links #3700
  2172. * fix(drivers): debug output properly displays '0' #3689
  2173. 3.8.38 / 2016-01-07
  2174. ===================
  2175. * fixed; aggregate.append an array #3730 [dbkup](https://github.com/dbkup)
  2176. 4.3.4 / 2015-12-23
  2177. ==================
  2178. * fix: upgrade mongodb driver to 2.1.2 for repl set error #3712 [sansmischevia](https://github.com/sansmischevia)
  2179. * docs: validation docs typo #3709 [ivanmaeder](https://github.com/ivanmaeder)
  2180. * style: remove unused variables #3708 [ChristianMurphy](https://github.com/ChristianMurphy)
  2181. * fix(schema): duck-typing for schemas #3703 [mgcrea](https://github.com/mgcrea)
  2182. * docs: connection sample code issue #3697
  2183. * fix(schema): duck-typing for schemas #3693 [mgcrea](https://github.com/mgcrea)
  2184. * docs: clarify id schema option #3638
  2185. 4.3.3 / 2015-12-18
  2186. ==================
  2187. * fix(connection): properly support 'replSet' as well as 'replset' #3688 [taxilian](https://github.com/taxilian)
  2188. * fix(document): single nested doc pre hooks called before nested doc array #3687 [aliatsis](https://github.com/aliatsis)
  2189. 4.3.2 / 2015-12-17
  2190. ==================
  2191. * fix(document): .set() into single nested schemas #3686
  2192. * fix(connection): support 'replSet' as well as 'replset' option #3685
  2193. * fix(document): bluebird unhandled rejection when validating doc arrays #3681
  2194. * fix(document): hooks for doc arrays in single nested schemas #3680
  2195. * fix(document): post hooks for single nested schemas #3679
  2196. * fix: remove unused npm module #3674 [sybarite](https://github.com/sybarite)
  2197. * fix(model): don't swallow exceptions in nested doc save callback #3671
  2198. * docs: update keepAlive info #3667 [ChrisZieba](https://github.com/ChrisZieba)
  2199. * fix(document): strict 'throw' throws a specific mongoose error #3662
  2200. * fix: flakey test #3332
  2201. * fix(query): more robust check for RegExp #2969
  2202. 4.3.1 / 2015-12-11
  2203. ==================
  2204. * feat(aggregate): `.sample()` helper #3665
  2205. * fix(query): bitwise query operators with buffers #3663
  2206. * docs(migration): clarify `new` option and findByIdAndUpdate #3661
  2207. 4.3.0 / 2015-12-09
  2208. ==================
  2209. * feat(query): support for mongodb 3.2 bitwise query operators #3660
  2210. * style: use comma-last style consistently #3657 [ChristianMurphy](https://github.com/ChristianMurphy)
  2211. * feat: upgrade mongodb driver to 2.1.0 for full MongoDB 3.2 support #3656
  2212. * feat(aggregate): `.lookup()` helper #3532
  2213. 4.2.10 / 2015-12-08
  2214. ===================
  2215. * fixed; upgraded marked #3653 [ChristianMurphy](https://github.com/ChristianMurphy)
  2216. * docs; cross-db populate #3648
  2217. * docs; update mocha URL #3646 [ojhaujjwal](https://github.com/ojhaujjwal)
  2218. * fixed; call close callback asynchronously #3645
  2219. * docs; virtuals.html issue #3644 [Psarna94](https://github.com/Psarna94)
  2220. * fixed; single embedded doc casting on init #3642
  2221. * docs; validation docs improvements #3640
  2222. 4.2.9 / 2015-12-02
  2223. ==================
  2224. * docs; defaults docs #3625
  2225. * fix; nested numeric keys causing an embedded document crash #3623
  2226. * fix; apply path getters before virtual getters #3618
  2227. * fix; casting for arrays in single nested schemas #3616
  2228. 4.2.8 / 2015-11-25
  2229. ==================
  2230. * docs; clean up README links #3612 [ReadmeCritic](https://github.com/ReadmeCritic)
  2231. * fix; ESLint improvements #3605 [ChristianMurphy](https://github.com/ChristianMurphy)
  2232. * fix; assigning single nested subdocs #3601
  2233. * docs; describe custom logging functions in `mongoose.set()` docs #3557
  2234. 4.2.7 / 2015-11-20
  2235. ==================
  2236. * fixed; readPreference connection string option #3600
  2237. * fixed; pulling from manually populated arrays #3598 #3579
  2238. * docs; FAQ about OverwriteModelError #3597 [stcruy](https://github.com/stcruy)
  2239. * fixed; setting single embedded schemas to null #3596
  2240. * fixed; indexes for single embedded schemas #3594
  2241. * docs; clarify projection for `findOne()` #3593 [gunar](https://github.com/gunar)
  2242. * fixed; .ownerDocument() method on single embedded schemas #3589
  2243. * fixed; properly throw casterror for query on single embedded schema #3580
  2244. * upgraded; mongodb driver -> 2.0.49 for reconnect issue fix #3481
  2245. 4.2.6 / 2015-11-16
  2246. ==================
  2247. * fixed; ability to manually populate an array #3575
  2248. * docs; clarify `isAsync` parameter to hooks #3573
  2249. * fixed; use captureStackTrace if possible instead #3571
  2250. * fixed; crash with buffer and update validators #3565 [johnpeb](https://github.com/johnpeb)
  2251. * fixed; update casting with operators overwrite: true #3564
  2252. * fixed; validation with single embedded docs #3562
  2253. * fixed; inline docs inherit parents $type key #3560
  2254. * docs; bad grammar in populate docs #3559 [amaurymedeiros](https://github.com/amaurymedeiros)
  2255. * fixed; properly handle populate option for find() #2321
  2256. 3.8.37 / 2015-11-16
  2257. ===================
  2258. * fixed; use retainKeyOrder for cloning update op #3572
  2259. 4.2.5 / 2015-11-09
  2260. ==================
  2261. * fixed; handle setting fields in pre update hooks with exec #3549
  2262. * upgraded; ESLint #3547 [ChristianMurphy](https://github.com/ChristianMurphy)
  2263. * fixed; bluebird unhandled rejections with cast errors and .exec #3543
  2264. * fixed; min/max validators handling undefined #3539
  2265. * fixed; standalone mongos connections #3537
  2266. * fixed; call `.toObject()` when setting a single nested doc #3535
  2267. * fixed; single nested docs now have methods #3534
  2268. * fixed; single nested docs with .create() #3533 #3521 [tusbar](https://github.com/tusbar)
  2269. * docs; deep populate docs #3528
  2270. * fixed; deep populate schema ref handling #3507
  2271. * upgraded; mongodb driver -> 2.0.48 for sort overflow issue #3493
  2272. * docs; clarify default ids for discriminators #3482
  2273. * fixed; properly support .update(doc) #3221
  2274. 4.2.4 / 2015-11-02
  2275. ==================
  2276. * fixed; upgraded `ms` package for security vulnerability #3524 [fhemberger](https://github.com/fhemberger)
  2277. * fixed; ESlint rules #3517 [ChristianMurphy](https://github.com/ChristianMurphy)
  2278. * docs; typo in aggregation docs #3513 [rafakato](https://github.com/rafakato)
  2279. * fixed; add `dontThrowCastError` option to .update() for promises #3512
  2280. * fixed; don't double-cast buffers in node 4.x #3510 #3496
  2281. * fixed; population with single embedded schemas #3501
  2282. * fixed; pre('set') hooks work properly #3479
  2283. * docs; promises guide #3441
  2284. 4.2.3 / 2015-10-26
  2285. ==================
  2286. * docs; remove unreferenced function in middleware.jade #3506
  2287. * fixed; handling auth with no username/password #3500 #3498 #3484 [mleanos](https://github.com/mleanos)
  2288. * fixed; more ESlint rules #3491 [ChristianMurphy](https://github.com/ChristianMurphy)
  2289. * fixed; swallowing exceptions in save callback #3478
  2290. * docs; fixed broken links in subdocs guide #3477
  2291. * fixed; casting booleans to numbers #3475
  2292. * fixed; report CastError for subdoc arrays in findOneAndUpdate #3468
  2293. * fixed; geoNear returns ES6 promise #3458
  2294. 4.2.2 / 2015-10-22
  2295. ==================
  2296. * fixed; go back to old pluralization code #3490
  2297. 4.2.1 / 2015-10-22
  2298. ==================
  2299. * fixed; pluralization issues #3492 [ChristianMurphy](https://github.com/ChristianMurphy)
  2300. 4.2.0 / 2015-10-22
  2301. ==================
  2302. * added; support for skipVersioning for document arrays #3467 [chazmo03](https://github.com/chazmo03)
  2303. * added; ability to customize schema 'type' key #3459 #3245
  2304. * fixed; writeConcern for index builds #3455
  2305. * added; emit event when individual index build starts #3440 [objectiveSee](https://github.com/objectiveSee)
  2306. * added; 'context' option for update validators #3430
  2307. * refactor; pluralization now in separate pluralize-mongoose npm module #3415 [ChristianMurphy](https://github.com/ChristianMurphy)
  2308. * added; customizable error validation messages #3406 [geronime](https://github.com/geronime)
  2309. * added; support for passing 'minimize' option to update #3381
  2310. * added; ability to customize debug logging format #3261
  2311. * added; baseModelName property for discriminator models #3202
  2312. * added; 'emitIndexErrors' option #3174
  2313. * added; 'async' option for aggregation cursor to support buffering #3160
  2314. * added; ability to skip validation for individual save() calls #2981
  2315. * added; single embedded schema support #2689 #585
  2316. * added; depopulate function #2509
  2317. 4.1.12 / 2015-10-19
  2318. ===================
  2319. * docs; use readPreference instead of slaveOk for Query.setOptions docs #3471 [buunguyen](https://github.com/buunguyen)
  2320. * fixed; more helpful error when regexp contains null bytes #3456
  2321. * fixed; x509 auth issue #3454 [NoxHarmonium](https://github.com/NoxHarmonium)
  2322. 3.8.36 / 2015-10-18
  2323. ===================
  2324. * fixed; Make array props non-enumerable #3461 [boblauer](https://github.com/boblauer)
  2325. 4.1.11 / 2015-10-12
  2326. ===================
  2327. * fixed; update timestamps for update() if they're enabled #3450 [isayme](https://github.com/isayme)
  2328. * fixed; unit test error on node 0.10 #3449 [isayme](https://github.com/isayme)
  2329. * docs; timestamp option docs #3448 [isayme](https://github.com/isayme)
  2330. * docs; fix unexpected indent #3443 [isayme](https://github.com/isayme)
  2331. * fixed; use ES6 promises for Model.prototype.remove() #3442
  2332. * fixed; don't use unused 'safe' option for index builds #3439
  2333. * fixed; elemMatch casting bug #3437 #3435 [DefinitelyCarter](https://github.com/DefinitelyCarter)
  2334. * docs; schema.index docs #3434
  2335. * fixed; exceptions in save() callback getting swallowed on mongodb 2.4 #3371
  2336. 4.1.10 / 2015-10-05
  2337. ===================
  2338. * docs; improve virtuals docs to explain virtuals schema option #3433 [zoyaH](https://github.com/zoyaH)
  2339. * docs; MongoDB server version compatibility guide #3427
  2340. * docs; clarify that findById and findByIdAndUpdate fire hooks #3422
  2341. * docs; clean up Model.save() docs #3420
  2342. * fixed; properly handle projection with just id #3407 #3412
  2343. * fixed; infinite loop when database document is corrupted #3405
  2344. * docs; clarify remove middleware #3388
  2345. 4.1.9 / 2015-09-28
  2346. ==================
  2347. * docs; minlength and maxlength string validation docs #3368 #3413 [cosmosgenius](https://github.com/cosmosgenius)
  2348. * fixed; linting for infix operators #3397 [ChristianMurphy](https://github.com/ChristianMurphy)
  2349. * fixed; proper casting for $all #3394
  2350. * fixed; unhandled rejection warnings with .create() #3391
  2351. * docs; clarify update validators on paths that aren't explicitly set #3386
  2352. * docs; custom validator examples #2778
  2353. 4.1.8 / 2015-09-21
  2354. ==================
  2355. * docs; fixed typo in example #3390 [kmctown](https://github.com/kmctown)
  2356. * fixed; error in toObject() #3387 [guumaster](https://github.com/guumaster)
  2357. * fixed; handling for casting null dates #3383 [alexmingoia](https://github.com/alexmingoia)
  2358. * fixed; passing composite ids to `findByIdAndUpdate` #3380
  2359. * fixed; linting #3376 #3375 [ChristianMurphy](https://github.com/ChristianMurphy)
  2360. * fixed; added NodeJS v4 to Travis #3374 [ChristianMurphy](https://github.com/ChristianMurphy)
  2361. * fixed; casting $elemMatch inside of $not #3373 [gaguirre](https://github.com/gaguirre)
  2362. * fixed; handle case where $slice is 0 #3369
  2363. * fixed; avoid running getters if path is populated #3357
  2364. * fixed; cast documents to objects when setting to a nested path #3346
  2365. 4.1.7 / 2015-09-14
  2366. ==================
  2367. * docs; typos in SchemaType documentation #3367 [jasson15](https://github.com/jasson15)
  2368. * fixed; MONGOOSE_DRIVER_PATH env variable again #3360
  2369. * docs; added validateSync docs #3353
  2370. * fixed; set findOne op synchronously in query #3344
  2371. * fixed; handling for `.pull()` on a documentarray without an id #3341
  2372. * fixed; use natural order for cloning update conditions #3338
  2373. * fixed; issue with strict mode casting for mixed type updates #3337
  2374. 4.1.6 / 2015-09-08
  2375. ==================
  2376. * fixed; MONGOOSE_DRIVER_PATH env variable #3345 [g13013](https://github.com/g13013)
  2377. * docs; global autoIndex option #3335 [albertorestifo](https://github.com/albertorestifo)
  2378. * docs; model documentation typos #3330
  2379. * fixed; report reason for CastError #3320
  2380. * fixed; .populate() no longer returns true after re-assigning #3308
  2381. * fixed; discriminators with aggregation geoNear #3304
  2382. * docs; discriminator docs #2743
  2383. 4.1.5 / 2015-09-01
  2384. ==================
  2385. * fixed; document.remove() removing all docs #3326 #3325
  2386. * fixed; connect() checks for rs_name in options #3299
  2387. * docs; examples for schema.set() #3288
  2388. * fixed; checkKeys issue with bluebird #3286 [gregthegeek](https://github.com/gregthegeek)
  2389. 4.1.4 / 2015-08-31
  2390. ==================
  2391. * fixed; ability to set strict: false for update #3305
  2392. * fixed; .create() properly uses ES6 promises #3297
  2393. * fixed; pre hooks on nested subdocs #3291 #3284 [aliatsis](https://github.com/aliatsis)
  2394. * docs; remove unclear text in .remove() docs #3282
  2395. * fixed; pre hooks called twice for 3rd-level nested doc #3281
  2396. * fixed; nested transforms #3279
  2397. * upgraded; mquery -> 1.6.3 #3278 #3272
  2398. * fixed; don't swallow callback errors by default #3273 #3222
  2399. * fixed; properly get nested paths from nested schemas #3265
  2400. * fixed; remove() with id undefined deleting all docs #3260 [thanpolas](https://github.com/thanpolas)
  2401. * fixed; handling for non-numeric projections #3256
  2402. * fixed; findById with id undefined returning first doc #3255
  2403. * fixed; use retainKeyOrder for update #3215
  2404. * added; passRawResult option to findOneAndUpdate for backwards compat #3173
  2405. 4.1.3 / 2015-08-16
  2406. ==================
  2407. * fixed; getUpdate() in pre update hooks #3520 [gregthegeek](https://github.com/gregthegeek)
  2408. * fixed; handleArray() ensures arg is an array #3238 [jloveridge](https://github.com/jloveridge)
  2409. * fixed; refresh required path cache when recreating docs #3199
  2410. * fixed; $ operator on unwind aggregation helper #3197
  2411. * fixed; findOneAndUpdate() properly returns raw result as third arg to callback #3173
  2412. * fixed; querystream with dynamic refs #3108
  2413. 3.8.35 / 2015-08-14
  2414. ===================
  2415. * fixed; handling for minimize on nested objects #2930
  2416. * fixed; don't crash when schema.path.options undefined #1824
  2417. 4.1.2 / 2015-08-10
  2418. ==================
  2419. * fixed; better handling for Jade templates #3241 [kbadk](https://github.com/kbadk)
  2420. * added; ESlint trailing spaces #3234 [ChristianMurphy](https://github.com/ChristianMurphy)
  2421. * added; ESlint #3191 [ChristianMurphy](https://github.com/ChristianMurphy)
  2422. * fixed; properly emit event on disconnect #3183
  2423. * fixed; copy options properly using Query.toConstructor() #3176
  2424. * fixed; setMaxListeners() issue in browser build #3170
  2425. * fixed; node driver -> 2.0.40 to not store undefined keys as null #3169
  2426. * fixed; update validators handle positional operator #3167
  2427. * fixed; handle $all + $elemMatch query casting #3163
  2428. * fixed; post save hooks don't swallow extra args #3155
  2429. * docs; spelling mistake in index.jade #3154
  2430. * fixed; don't crash when toObject() has no fields #3130
  2431. * fixed; apply toObject() recursively for find and update queries #3086 [naoina](https://github.com/naoina)
  2432. 4.1.1 / 2015-08-03
  2433. ==================
  2434. * fixed; aggregate exec() crash with no callback #3212 #3198 [jpgarcia](https://github.com/jpgarcia)
  2435. * fixed; pre init hooks now properly synchronous #3207 [burtonjc](https://github.com/burtonjc)
  2436. * fixed; updateValidators doesn't flatten dates #3206 #3194 [victorkohl](https://github.com/victorkohl)
  2437. * fixed; default fields don't make document dirty between saves #3205 [burtonjc](https://github.com/burtonjc)
  2438. * fixed; save passes 0 as numAffected rather than undefined when no change #3195 [burtonjc](https://github.com/burtonjc)
  2439. * fixed; better handling for positional operator in update #3185
  2440. * fixed; use Travis containers #3181 [ChristianMurphy](https://github.com/ChristianMurphy)
  2441. * fixed; leaked variable #3180 [ChristianMurphy](https://github.com/ChristianMurphy)
  2442. 4.1.0 / 2015-07-24
  2443. ==================
  2444. * added; `schema.queue()` now public #3193
  2445. * added; raw result as third parameter to findOneAndX callback #3173
  2446. * added; ability to run validateSync() on only certain fields #3153
  2447. * added; subPopulate #3103 [timbur](https://github.com/timbur)
  2448. * added; $isDefault function on documents #3077
  2449. * added; additional properties for built-in validator messages #3063 [KLicheR](https://github.com/KLicheR)
  2450. * added; getQuery() and getUpdate() functions for Query #3013
  2451. * added; export DocumentProvider #2996
  2452. * added; ability to remove path from schema #2993 [JohnnyEstilles](https://github.com/JohnnyEstilles)
  2453. * added; .explain() helper for aggregate #2714
  2454. * added; ability to specify which ES6-compatible promises library mongoose uses #2688
  2455. * added; export Aggregate #1910
  2456. 4.0.8 / 2015-07-20
  2457. ==================
  2458. * fixed; assignment with document arrays #3178 [rosston](https://github.com/rosston)
  2459. * docs; remove duplicate paragraph #3164 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2460. * docs; improve findOneAndXYZ parameter descriptions #3159 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2461. * docs; add findOneAndRemove to list of supported middleware #3158
  2462. * docs; clarify ensureIndex #3156
  2463. * fixed; refuse to save/remove document without id #3118
  2464. * fixed; hooks next() no longer accidentally returns promise #3104
  2465. * fixed; strict mode for findOneAndUpdate #2947
  2466. * added; .min.js.gz file for browser component #2806
  2467. 3.8.34 / 2015-07-20
  2468. ===================
  2469. * fixed; allow using $rename #3171
  2470. * fixed; no longer modifies update arguments #3008
  2471. 4.0.7 / 2015-07-11
  2472. ==================
  2473. * fixed; documentarray id method when using object id #3157 [siboulet](https://github.com/siboulet)
  2474. * docs; improve findById docs #3147
  2475. * fixed; update validators handle null properly #3136 [odeke-em](https://github.com/odeke-em)
  2476. * docs; jsdoc syntax errors #3128 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2477. * docs; fix typo #3126 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2478. * docs; proper formatting in queries.jade #3121 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2479. * docs; correct example for string maxlength validator #3111 [rhmeeuwisse](https://github.com/rhmeeuwisse)
  2480. * fixed; setDefaultsOnInsert with arrays #3107
  2481. * docs; LearnBoost -> Automattic in package.json #3099
  2482. * docs; pre update hook example #3094 [danpe](https://github.com/danpe)
  2483. * docs; clarify query middleware example #3051
  2484. * fixed; ValidationErrors in strict mode #3046
  2485. * fixed; set findOneAndUpdate properties before hooks run #3024
  2486. 3.8.33 / 2015-07-10
  2487. ===================
  2488. * upgraded; node driver -> 1.4.38
  2489. * fixed; dont crash when `match` validator undefined
  2490. 4.0.6 / 2015-06-21
  2491. ==================
  2492. * upgraded; node driver -> 2.0.34 #3087
  2493. * fixed; apply setters on addToSet, etc #3067 [victorkohl](https://github.com/victorkohl)
  2494. * fixed; missing semicolons #3065 [sokolikp](https://github.com/sokolikp)
  2495. * fixed; proper handling for async doc hooks #3062 [gregthegeek](https://github.com/gregthegeek)
  2496. * fixed; dont set failed populate field to null if other docs are successfully populated #3055 [eloytoro](https://github.com/eloytoro)
  2497. * fixed; setDefaultsOnInsert with document arrays #3034 [taxilian](https://github.com/taxilian)
  2498. * fixed; setters fired on array items #3032
  2499. * fixed; stop validateSync() on first error #3025 [victorkohl](https://github.com/victorkohl)
  2500. * docs; improve query docs #3016
  2501. * fixed; always exclude _id when its deselected #3010
  2502. * fixed; enum validator kind property #3009
  2503. * fixed; mquery collection names #3005
  2504. * docs; clarify mongos option #3000
  2505. * docs; clarify that query builder has a .then() #2995
  2506. * fixed; race condition in dynamic ref #2992
  2507. 3.8.31 / 2015-06-20
  2508. ===================
  2509. * fixed; properly handle text search with discriminators and $meta #2166
  2510. 4.0.5 / 2015-06-05
  2511. ==================
  2512. * fixed; ObjectIds and buffers when mongodb driver is a sibling dependency #3050 #3048 #3040 #3031 #3020 #2988 #2951
  2513. * fixed; warn user when 'increment' is used in schema #3039
  2514. * fixed; setDefaultsOnInsert with array in schema #3035
  2515. * fixed; dont use default Object toString to cast to string #3030
  2516. * added; npm badge #3020 [odeke-em](https://github.com/odeke-em)
  2517. * fixed; proper handling for calling .set() with a subdoc #2782
  2518. * fixed; dont throw cast error when using $rename on non-string path #1845
  2519. 3.8.30 / 2015-06-05
  2520. ===================
  2521. * fixed; enable users to set all options with tailable() #2883
  2522. 4.0.4 / 2015-05-28
  2523. ==================
  2524. * docs; findAndModify new parameter correct default value #3012 [JonForest](https://github.com/JonForest)
  2525. * docs; clarify pluralization rules #2999 [anonmily](https://github.com/anonmily)
  2526. * fix; discriminators with schema methods #2978
  2527. * fix; make `isModified` a schema reserved keyword #2975
  2528. * fix; properly fire setters when initializing path with object #2943
  2529. * fix; can use `setDefaultsOnInsert` without specifying `runValidators` #2938
  2530. * fix; always set validation errors `kind` property #2885
  2531. * upgraded; node driver -> 2.0.33 #2865
  2532. 3.8.29 / 2015-05-27
  2533. ===================
  2534. * fixed; Handle JSON.stringify properly for nested docs #2990
  2535. 4.0.3 / 2015-05-13
  2536. ==================
  2537. * upgraded; mquery -> 1.5.1 #2983
  2538. * docs; clarify context for query middleware #2974
  2539. * docs; fix missing type -> kind rename in History.md #2961
  2540. * fixed; broken ReadPreference include on Heroku #2957
  2541. * docs; correct form for cursor aggregate option #2955
  2542. * fixed; sync post hooks now properly called after function #2949 #2925
  2543. * fixed; fix sub-doc validate() function #2929
  2544. * upgraded; node driver -> 2.0.30 #2926
  2545. * docs; retainKeyOrder for save() #2924
  2546. * docs; fix broken class names #2913
  2547. * fixed; error when using node-clone on a doc #2909
  2548. * fixed; no more hard references to bson #2908 #2906
  2549. * fixed; dont overwrite array values #2907 [naoina](https://github.com/naoina)
  2550. * fixed; use readPreference=primary for findOneAndUpdate #2899 #2823
  2551. * docs; clarify that update validators only run on $set and $unset #2889
  2552. * fixed; set kind consistently for built-in validators #2885
  2553. * docs; single field populated documents #2884
  2554. * fixed; nested objects are now enumerable #2880 [toblerpwn](https://github.com/toblerpwn)
  2555. * fixed; properly populate field when ref, lean, stream used together #2841
  2556. * docs; fixed migration guide jade error #2807
  2557. 3.8.28 / 2015-05-12
  2558. ===================
  2559. * fixed; proper handling for toJSON options #2910
  2560. * fixed; dont attach virtuals to embedded docs in update() #2046
  2561. 4.0.2 / 2015-04-23
  2562. ==================
  2563. * fixed; error thrown when calling .validate() on subdoc not in an array #2902
  2564. * fixed; rename define() to play nice with webpack #2900 [jspears](https://github.com/jspears)
  2565. * fixed; pre validate called twice with discriminators #2892
  2566. * fixed; .inspect() on mongoose.Types #2875
  2567. * docs; correct callback params for Model.update #2872
  2568. * fixed; setDefaultsOnInsert now works when runValidators not specified #2870
  2569. * fixed; Document now wraps EventEmitter.addListener #2867
  2570. * fixed; call non-hook functions in schema queue #2856
  2571. * fixed; statics can be mocked out for tests #2848 [ninelb](https://github.com/ninelb)
  2572. * upgraded; mquery 1.4.0 for bluebird bug fix #2846
  2573. * fixed; required validators run first #2843
  2574. * docs; improved docs for new option to findAndMody #2838
  2575. * docs; populate example now uses correct field #2837 [swilliams](https://github.com/swilliams)
  2576. * fixed; pre validate changes causing VersionError #2835
  2577. * fixed; get path from correct place when setting CastError #2832
  2578. * docs; improve docs for Model.update() function signature #2827 [irnc](https://github.com/irnc)
  2579. * fixed; populating discriminators #2825 [chetverikov](https://github.com/chetverikov)
  2580. * fixed; discriminators with nested schemas #2821
  2581. * fixed; CastErrors with embedded docs #2819
  2582. * fixed; post save hook context #2816
  2583. * docs; 3.8.x -> 4.x migration guide #2807
  2584. * fixed; proper _distinct copying for query #2765 [cdelauder](https://github.com/cdelauder)
  2585. 3.8.27 / 2015-04-22
  2586. ===================
  2587. * fixed; dont duplicate db calls on Q.ninvoke() #2864
  2588. * fixed; Model.find arguments naming in docs #2828
  2589. * fixed; Support ipv6 in connection strings #2298
  2590. 3.8.26 / 2015-04-07
  2591. ===================
  2592. * fixed; TypeError when setting date to undefined #2833
  2593. * fixed; handle CastError properly in distinct() with no callback #2786
  2594. * fixed; broken links in queries docs #2779
  2595. * fixed; dont mark buffer as modified when setting type initially #2738
  2596. * fixed; dont crash when using slice with populate #1934
  2597. 4.0.1 / 2015-03-28
  2598. ==================
  2599. * fixed; properly handle empty cast doc in update() with promises #2796
  2600. * fixed; unstable warning #2794
  2601. * fixed; findAndModify docs now show new option is false by default #2793
  2602. 4.0.0 / 2015-03-25
  2603. ==================
  2604. * fixed; on-the-fly schema docs typo #2783 [artiifix](https://github.com/artiifix)
  2605. * fixed; cast error validation handling #2775 #2766 #2678
  2606. * fixed; discriminators with populate() #2773 #2719 [chetverikov](https://github.com/chetverikov)
  2607. * fixed; increment now a reserved path #2709
  2608. * fixed; avoid sending duplicate object ids in populate() #2683
  2609. * upgraded; mongodb to 2.0.24 to properly emit reconnect event multiple times #2656
  2610. 4.0.0-rc4 / 2015-03-14
  2611. ======================
  2612. * fixed; toObject virtuals schema option handled properly #2751
  2613. * fixed; update validators work on document arrays #2733
  2614. * fixed; check for cast errors on $set #2729
  2615. * fixed; instance field set for all schema types #2727 [csdco](https://github.com/csdco)
  2616. * fixed; dont run other validators if required fails #2725
  2617. * fixed; custom getters execute on ref paths #2610
  2618. * fixed; save defaults if they were set when doc was loaded from db #2558
  2619. * fixed; pre validate now runs before pre save #2462
  2620. * fixed; no longer throws errors with --use_strict #2281
  2621. 3.8.25 / 2015-03-13
  2622. ===================
  2623. * fixed; debug output reverses order of aggregation keys #2759
  2624. * fixed; $eq is a valid query selector in 3.0 #2752
  2625. * fixed; upgraded node driver to 1.4.32 for handling non-numeric poolSize #2682
  2626. * fixed; update() with overwrite sets _id for nested docs #2658
  2627. * fixed; casting for operators in $elemMatch #2199
  2628. 4.0.0-rc3 / 2015-02-28
  2629. ======================
  2630. * fixed; update() pre hooks run before validators #2706
  2631. * fixed; setters not called on arrays of refs #2698 [brandom](https://github.com/brandom)
  2632. * fixed; use node driver 2.0.18 for nodejs 0.12 support #2685
  2633. * fixed; comments reference file that no longer exists #2681
  2634. * fixed; populated() returns _id of manually populated doc #2678
  2635. * added; ability to exclude version key in toObject() #2675
  2636. * fixed; dont allow setting nested path to a string #2592
  2637. * fixed; can cast objects with _id field to ObjectIds #2581
  2638. * fixed; on-the-fly schema getters #2360
  2639. * added; strict option for findOneAndUpdate() #1967
  2640. 3.8.24 / 2015-02-25
  2641. ===================
  2642. * fixed; properly apply child schema transforms #2691
  2643. * fixed; make copy of findOneAndUpdate options before modifying #2687
  2644. * fixed; apply defaults when parent path is selected #2670 #2629
  2645. * fixed; properly get ref property for nested paths #2665
  2646. * fixed; node driver makes copy of authenticate options before modifying them #2619
  2647. * fixed; dont block process exit when auth fails #2599
  2648. * fixed; remove redundant clone in update() #2537
  2649. 4.0.0-rc2 / 2015-02-10
  2650. ======================
  2651. * added; io.js to travis build
  2652. * removed; browser build dependencies not installed by default
  2653. * added; dynamic refpaths #2640 [chetverikov](https://github.com/chetverikov)
  2654. * fixed; dont call child schema transforms on parent #2639 [chetverikov](https://github.com/chetverikov)
  2655. * fixed; get rid of remove option if new is set in findAndModify #2598
  2656. * fixed; aggregate all document array validation errors #2589
  2657. * fixed; custom setters called when setting value to undefined #1892
  2658. 3.8.23 / 2015-02-06
  2659. ===================
  2660. * fixed; unset opts.remove when upsert is true #2519
  2661. * fixed; array saved as object when path is object in array #2442
  2662. * fixed; inline transforms #2440
  2663. * fixed; check for callback in count() #2204
  2664. * fixed; documentation for selecting fields #1534
  2665. 4.0.0-rc1 / 2015-02-01
  2666. ======================
  2667. * fixed; use driver 2.0.14
  2668. * changed; use transform: true by default #2245
  2669. 4.0.0-rc0 / 2015-01-31
  2670. ===================
  2671. * fixed; wrong order for distinct() params #2628
  2672. * fixed; handling no query argument to remove() #2627
  2673. * fixed; createModel and discriminators #2623 [ashaffer](https://github.com/ashaffer)
  2674. * added; pre('count') middleware #2621
  2675. * fixed; double validation calls on document arrays #2618
  2676. * added; validate() catches cast errors #2611
  2677. * fixed; respect replicaSet parameter in connection string #2609
  2678. * added; can explicitly exclude paths from versioning #2576 [csabapalfi](https://github.com/csabapalfi)
  2679. * upgraded; driver to 2.0.15 #2552
  2680. * fixed; save() handles errors more gracefully in ES6 #2371
  2681. * fixed; undefined is now a valid argument to findOneAndUpdate #2272
  2682. * changed; `new` option to findAndModify ops is false by default #2262
  2683. 3.8.22 / 2015-01-24
  2684. ===================
  2685. * upgraded; node-mongodb-native to 1.4.28 #2587 [Climax777](https://github.com/Climax777)
  2686. * added; additional documentation for validators #2449
  2687. * fixed; stack overflow when creating massive arrays #2423
  2688. * fixed; undefined is a valid id for queries #2411
  2689. * fixed; properly create nested schema index when same schema used twice #2322
  2690. * added; link to plugin generator in docs #2085 [huei90](https://github.com/huei90)
  2691. * fixed; optional arguments documentation for findOne() #1971 [nachinius](https://github.com/nachinius)
  2692. 3.9.7 / 2014-12-19
  2693. ===================
  2694. * added; proper cursors for aggregate #2539 [changyy](https://github.com/changyy)
  2695. * added; min/max built-in validators for dates #2531 [bshamblen](https://github.com/bshamblen)
  2696. * fixed; save and validate are now reserved keywords #2380
  2697. * added; basic documentation for browser component #2256
  2698. * added; find and findOne hooks (query middleware) #2138
  2699. * fixed; throw a DivergentArrayError when saving positional operator queries #2031
  2700. * added; ability to use options as a document property #1416
  2701. * fixed; document no longer inherits from event emitter and so domain and _events are no longer reserved #1351
  2702. * removed; setProfiling #1349
  2703. 3.8.21 / 2014-12-18
  2704. ===================
  2705. * fixed; syntax in index.jade #2517 [elderbas](https://github.com/elderbas)
  2706. * fixed; writable statics #2510 #2528
  2707. * fixed; overwrite and explicit $set casting #2515
  2708. 3.9.6 / 2014-12-05
  2709. ===================
  2710. * added; correctly run validators on each element of array when entire array is modified #661 #1227
  2711. * added; castErrors in validation #1013 [jondavidjohn](https://github.com/jondavidjohn)
  2712. * added; specify text indexes in schema fields #1401 [sr527](https://github.com/sr527)
  2713. * added; ability to set field with validators to undefined #1594 [alabid](https://github.com/alabid)
  2714. * added; .create() returns an array when passed an array #1746 [alabid](https://github.com/alabid)
  2715. * added; test suite and docs for use with co and yield #2177 #2474
  2716. * fixed; subdocument toObject() transforms #2447 [chmanie](https://github.com/chmanie)
  2717. * fixed; Model.create() with save errors #2484
  2718. * added; pass options to .save() and .remove() #2494 [jondavidjohn](https://github.com/jondavidjohn)
  2719. 3.8.20 / 2014-12-01
  2720. ===================
  2721. * fixed; recursive readPref #2490 [kjvalencik](https://github.com/kjvalencik)
  2722. * fixed; make sure to copy parameters to update() before modifying #2406 [alabid](https://github.com/alabid)
  2723. * fixed; unclear documentation about query callbacks #2319
  2724. * fixed; setting a schema-less field to an empty object #2314 [alabid](https://github.com/alabid)
  2725. * fixed; registering statics and methods for discriminators #2167 [alabid](https://github.com/alabid)
  2726. 3.9.5 / 2014-11-10
  2727. ===================
  2728. * added; ability to disable autoIndex on a per-connection basis #1875 [sr527](https://github.com/sr527)
  2729. * fixed; `geoNear()` no longer enforces legacy coordinate pairs - supports GeoJSON #1987 [alabid](https://github.com/alabid)
  2730. * fixed; browser component works when minified with mangled variable names #2302
  2731. * fixed; `doc.errors` now cleared before `validate()` called #2302
  2732. * added; `execPopulate()` function to make `doc.populate()` compatible with promises #2317
  2733. * fixed; `count()` no longer throws an error when used with `sort()` #2374
  2734. * fixed; `save()` no longer recursively calls `save()` on populated fields #2418
  2735. 3.8.19 / 2014-11-09
  2736. ===================
  2737. * fixed; make sure to not override subdoc _ids on find #2276 [alabid](https://github.com/alabid)
  2738. * fixed; exception when comparing two documents when one lacks _id #2333 [slawo](https://github.com/slawo)
  2739. * fixed; getters for properties with non-strict schemas #2439 [alabid](https://github.com/alabid)
  2740. * fixed; inconsistent URI format in docs #2414 [sr527](https://github.com/sr527)
  2741. 3.9.4 / 2014-10-25
  2742. ==================
  2743. * fixed; statics no longer can be overwritten #2343 [nkcmr](https://github.com/chetverikov)
  2744. * added; ability to set single populated paths to documents #1530
  2745. * added; setDefaultsOnInsert and runValidator options for findOneAndUpdate() #860
  2746. 3.8.18 / 2014-10-22
  2747. ==================
  2748. * fixed; Dont use all toObject options in save #2340 [chetverikov](https://github.com/chetverikov)
  2749. 3.9.3 / 2014-10-01
  2750. =================
  2751. * added; support for virtuals that return objects #2294
  2752. * added; ability to manually hydrate POJOs into mongoose objects #2292
  2753. * added; setDefaultsOnInsert and runValidator options for update() #860
  2754. 3.8.17 / 2014-09-29
  2755. ==================
  2756. * fixed; use schema options retainKeyOrder in save() #2274
  2757. * fixed; fix skip in populate when limit is set #2252
  2758. * fixed; fix stack overflow when passing MongooseArray to findAndModify #2214
  2759. * fixed; optimize .length usage in populate #2289
  2760. 3.9.2 / 2014-09-08
  2761. ==================
  2762. * added; test coverage for browser component #2255
  2763. * added; in-order execution of validators #2243
  2764. * added; custom fields for validators #2132
  2765. * removed; exception thrown when find() used with count() #1950
  2766. 3.8.16 / 2014-09-08
  2767. ==================
  2768. * fixed; properly remove modified array paths if array has been overwritten #1638
  2769. * fixed; key check errors #1884
  2770. * fixed; make sure populate on an array always returns a Mongoose array #2214
  2771. * fixed; SSL connections with node 0.11 #2234
  2772. * fixed; return sensible strings for promise errors #2239
  2773. 3.9.1 / 2014-08-17
  2774. ==================
  2775. * added; alpha version of browser-side schema validation #2254
  2776. * added; support passing a function to schemas `required` field #2247
  2777. * added; support for setting updatedAt and createdAt timestamps #2227
  2778. * added; document.validate() returns a promise #2131
  2779. 3.8.15 / 2014-08-17
  2780. ==================
  2781. * fixed; Replica set connection string example in docs #2246
  2782. * fixed; bubble up parseError event #2229
  2783. * fixed; removed buggy populate cache #2176
  2784. * fixed; dont $inc versionKey if its being $set #1933
  2785. * fixed; cast $or and $and in $pull #1932
  2786. * fixed; properly cast to schema in stream() #1862
  2787. * fixed; memory leak in nested objects #1565 #2211 [devongovett](https://github.com/devongovett)
  2788. 3.8.14 / 2014-07-26
  2789. ==================
  2790. * fixed; stringifying MongooseArray shows nested arrays #2002
  2791. * fixed; use populated doc schema in toObject and toJSON by default #2035
  2792. * fixed; dont crash on arrays containing null #2140
  2793. * fixed; model.update w/ upsert has same return values on .exec and promise #2143
  2794. * fixed; better handling for populate limit with multiple documents #2151
  2795. * fixed; dont prevent users from adding weights to text index #2183
  2796. * fixed; helper for aggregation cursor #2187
  2797. * updated; node-mongodb-native to 1.4.7
  2798. 3.8.13 / 2014-07-15
  2799. ==================
  2800. * fixed; memory leak with isNew events #2159
  2801. * fixed; docs for overwrite option for update() #2144
  2802. * fixed; storeShard() handles dates properly #2127
  2803. * fixed; sub-doc changes not getting persisted to db after save #2082
  2804. * fixed; populate with _id: 0 actually removes _id instead of setting to undefined #2123
  2805. * fixed; save versionKey on findOneAndUpdate w/ upsert #2122
  2806. * fixed; fix typo in 2.8 docs #2120 [shakirullahi](https://github.com/shakirullahi)
  2807. * fixed; support maxTimeMs #2102 [yuukinajima](https://github.com/yuukinajima)
  2808. * fixed; support $currentDate #2019
  2809. * fixed; $addToSet handles objects without _ids properly #1973
  2810. * fixed; dont crash on invalid nearSphere query #1874
  2811. 3.8.12 / 2014-05-30
  2812. ==================
  2813. * fixed; single-server reconnect event fires #1672
  2814. * fixed; sub-docs not saved when pushed into populated array #1794
  2815. * fixed; .set() sometimes converts embedded docs to pojos #1954 [archangel-irk](https://github.com/archangel-irk)
  2816. * fixed; sub-doc changes not getting persisted to db after save #2082
  2817. * fixed; custom getter might cause mongoose to mistakenly think a path is dirty #2100 [pgherveou](https://github.com/pgherveou)
  2818. * fixed; chainable helper for allowDiskUse option in aggregation #2114
  2819. 3.9.0 (unstable) / 2014-05-22
  2820. ==================
  2821. * changed; added `domain` to reserved keywords #1338 #2052 [antoinepairet](https://github.com/antoinepairet)
  2822. * added; asynchronous post hooks #1977 #2081 [chopachom](https://github.com/chopachom) [JasonGhent](https://github.com/JasonGhent)
  2823. * added; using model for population, cross-db populate [mihai-chiorean](https://github.com/mihai-chiorean)
  2824. * added; can define a type for schema validators
  2825. * added; `doc.remove()` returns a promise #1619 [refack](https://github.com/refack)
  2826. * added; internal promises for hooks, pre-save hooks run in parallel #1732 [refack](https://github.com/refack)
  2827. * fixed; geoSearch hanging when no results returned #1846 [ghartnett](https://github.com/ghartnett)
  2828. * fixed; do not set .type property on ValidationError, use .kind instead #1323
  2829. 3.8.11 / 2014-05-22
  2830. ==================
  2831. * updated; node-mongodb-native to 1.4.5
  2832. * reverted; #2052, fixes #2097
  2833. 3.8.10 / 2014-05-20
  2834. ==================
  2835. * updated; node-mongodb-native to 1.4.4
  2836. * fixed; _.isEqual false negatives bug in js-bson #2070
  2837. * fixed; missing check for schema.options #2014
  2838. * fixed; missing support for $position #2024
  2839. * fixed; options object corruption #2049
  2840. * fixed; improvements to virtuals docs #2055
  2841. * fixed; added `domain` to reserved keywords #2052 #1338
  2842. 3.8.9 / 2014-05-08
  2843. ==================
  2844. * updated; mquery to 0.7.0
  2845. * updated; node-mongodb-native to 1.4.3
  2846. * fixed; $near failing against MongoDB 2.6
  2847. * fixed; relying on .options() to determine if collection exists
  2848. * fixed; $out aggregate helper
  2849. * fixed; all test failures against MongoDB 2.6.1, with caveat #2065
  2850. 3.8.8 / 2014-02-22
  2851. ==================
  2852. * fixed; saving Buffers #1914
  2853. * updated; expose connection states for user-land #1926 [yorkie](https://github.com/yorkie)
  2854. * updated; mquery to 0.5.3
  2855. * updated; added get / set to reserved path list #1903 [tstrimple](https://github.com/tstrimple)
  2856. * docs; README code highlighting, syntax fixes #1930 [IonicaBizau](https://github.com/IonicaBizau)
  2857. * docs; fixes link in the doc at #1925 [kapeels](https://github.com/kapeels)
  2858. * docs; add a missed word 'hook' for the description of the post-hook api #1924 [ipoval](https://github.com/ipoval)
  2859. 3.8.7 / 2014-02-09
  2860. ==================
  2861. * fixed; sending safe/read options in Query#exec #1895
  2862. * fixed; findOneAnd..() with sort #1887
  2863. 3.8.6 / 2014-01-30
  2864. ==================
  2865. * fixed; setting readPreferences #1895
  2866. 3.8.5 / 2014-01-23
  2867. ==================
  2868. * fixed; ssl setting when using URI #1882
  2869. * fixed; findByIdAndUpdate now respects the overwrite option #1809 [owenallenaz](https://github.com/owenallenaz)
  2870. 3.8.4 / 2014-01-07
  2871. ==================
  2872. * updated; mongodb driver to 1.3.23
  2873. * updated; mquery to 0.4.1
  2874. * updated; mpromise to 0.4.3
  2875. * fixed; discriminators now work when selecting fields #1820 [daemon1981](https://github.com/daemon1981)
  2876. * fixed; geoSearch with no results timeout #1846 [ghartnett](https://github.com/ghartnett)
  2877. * fixed; infitite recursion in ValidationError #1834 [chetverikov](https://github.com/chetverikov)
  2878. 3.8.3 / 2013-12-17
  2879. ==================
  2880. * fixed; setting empty array with model.update #1838
  2881. * docs; fix url
  2882. 3.8.2 / 2013-12-14
  2883. ==================
  2884. * fixed; enum validation of multiple values #1778 [heroicyang](https://github.com/heroicyang)
  2885. * fixed; global var leak #1803
  2886. * fixed; post remove now fires on subdocs #1810
  2887. * fixed; no longer set default empty array for geospatial-indexed fields #1668 [shirish87](https://github.com/shirish87)
  2888. * fixed; model.stream() not hydrating discriminators correctly #1792 [j](https://github.com/j)
  2889. * docs: Stablility -> Stability [nikmartin](https://github.com/nikmartin)
  2890. * tests; improve shard error handling
  2891. 3.8.1 / 2013-11-19
  2892. ==================
  2893. * fixed; mishandling of Dates with minimize/getters #1764
  2894. * fixed; Normalize bugs.email, so `npm` will shut up #1769 [refack](https://github.com/refack)
  2895. * docs; Improve the grammar where "lets us" was used #1777 [alexyoung](https://github.com/alexyoung)
  2896. * docs; Fix some grammatical issues in the documentation #1777 [alexyoung](https://github.com/alexyoung)
  2897. * docs; fix Query api exposure
  2898. * docs; fix return description
  2899. * docs; Added Notes on findAndUpdate() #1750 [sstadelman](https://github.com/sstadelman)
  2900. * docs; Update version number in README #1762 [Fodi69](https://github.com/Fodi69)
  2901. 3.8.0 / 2013-10-31
  2902. ==================
  2903. * updated; warn when using an unstable version
  2904. * updated; error message returned in doc.save() #1595
  2905. * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
  2906. * updated; mquery to 0.3.2
  2907. * updated; mocha to 1.12.0
  2908. * updated; mpromise 0.3.0
  2909. * updated; sliced 0.0.5
  2910. * removed; mongoose.Error.DocumentError (never used)
  2911. * removed; namedscope (undocumented and broken) #679 #642 #455 #379
  2912. * changed; no longer offically supporting node 0.6.x
  2913. * changed; query.within getter is now a method -> query.within()
  2914. * changed; query.intersects getter is now a method -> query.intersects()
  2915. * added; custom error msgs for built-in validators #747
  2916. * added; discriminator support #1647 #1003 [j](https://github.com/j)
  2917. * added; support disabled collection name pluralization #1350 #1707 [refack](https://github.com/refack)
  2918. * added; support for GeoJSON to Query#near [ebensing](https://github.com/ebensing)
  2919. * added; stand-alone base query support - query.toConstructor() [ebensing](https://github.com/ebensing)
  2920. * added; promise support to geoSearch #1614 [ebensing](https://github.com/ebensing)
  2921. * added; promise support for geoNear #1614 [ebensing](https://github.com/ebensing)
  2922. * added; connection.useDb() #1124 [ebensing](https://github.com/ebensing)
  2923. * added; promise support to model.mapReduce()
  2924. * added; promise support to model.ensureIndexes()
  2925. * added; promise support to model.populate()
  2926. * added; benchmarks [ebensing](https://github.com/ebensing)
  2927. * added; publicly exposed connection states #1585
  2928. * added; $geoWithin support #1529 $1455 [ebensing](https://github.com/ebensing)
  2929. * added; query method chain validation
  2930. * added; model.update `overwrite` option
  2931. * added; model.geoNear() support #1563 [ebensing](https://github.com/ebensing)
  2932. * added; model.geoSearch() support #1560 [ebensing](https://github.com/ebensing)
  2933. * added; MongooseBuffer#subtype()
  2934. * added; model.create() now returns a promise #1340
  2935. * added; support for `awaitdata` query option
  2936. * added; pass the doc to doc.remove() callback #1419 [JoeWagner](https://github.com/JoeWagner)
  2937. * added; aggregation query builder #1404 [njoyard](https://github.com/njoyard)
  2938. * fixed; document.toObject when using `minimize` and `getters` options #1607 [JedWatson](https://github.com/JedWatson)
  2939. * fixed; Mixed types can now be required #1722 [Reggino](https://github.com/Reggino)
  2940. * fixed; do not pluralize model names not ending with letters #1703 [refack](https://github.com/refack)
  2941. * fixed; repopulating modified populated paths #1697
  2942. * fixed; doc.equals() when _id option is set to false #1687
  2943. * fixed; strict mode warnings #1686
  2944. * fixed; $near GeoJSON casting #1683
  2945. * fixed; nearSphere GeoJSON query builder
  2946. * fixed; population field selection w/ strings #1669
  2947. * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
  2948. * fixed; handle another versioning edge case #1520
  2949. * fixed; excluding subdocument fields #1280 [ebensing](https://github.com/ebensing)
  2950. * fixed; allow array properties to be set to null with findOneAndUpdate [aheuermann](https://github.com/aheuermann)
  2951. * fixed; subdocuments now use own toJSON opts #1376 [ebensing](https://github.com/ebensing)
  2952. * fixed; model#geoNear fulfills promise when results empty #1658 [ebensing](https://github.com/ebensing)
  2953. * fixed; utils.merge no longer overrides props and methods #1655 [j](https://github.com/j)
  2954. * fixed; subdocuments now use their own transform #1412 [ebensing](https://github.com/ebensing)
  2955. * fixed; model.remove() removes only what is necessary #1649
  2956. * fixed; update() now only runs with cb or explicit true #1644
  2957. * fixed; casting ref docs on creation #1606 [ebensing](https://github.com/ebensing)
  2958. * fixed; model.update "overwrite" option works as documented
  2959. * fixed; query#remove() works as documented
  2960. * fixed; "limit" correctly applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
  2961. * fixed; issue with positional operator on ref docs #1572 [ebensing](https://github.com/ebensing)
  2962. * fixed; benchmarks to actually output valid json
  2963. * deprecated; promise#addBack (use promise#onResolve)
  2964. * deprecated; promise#complete (use promise#fulfill)
  2965. * deprecated; promise#addCallback (use promise#onFulFill)
  2966. * deprecated; promise#addErrback (use promise#onReject)
  2967. * deprecated; query.nearSphere() (use query.near)
  2968. * deprecated; query.center() (use query.circle)
  2969. * deprecated; query.centerSphere() (use query.circle)
  2970. * deprecated; query#slaveOk (use query#read)
  2971. * docs; custom validator messages
  2972. * docs; 10gen -> MongoDB
  2973. * docs; add Date method caveats #1598
  2974. * docs; more validation details
  2975. * docs; state which branch is stable/unstable
  2976. * docs; mention that middleware does not run on Models
  2977. * docs; promise.fulfill()
  2978. * docs; fix readme spelling #1483 [yorchopolis](https://github.com/yorchopolis)
  2979. * docs; fixed up the README and examples [ebensing](https://github.com/ebensing)
  2980. * website; add "show code" for properties
  2981. * website; move "show code" links down
  2982. * website; update guide
  2983. * website; add unstable docs
  2984. * website; many improvements
  2985. * website; fix copyright #1439
  2986. * website; server.js -> static.js #1546 [nikmartin](https://github.com/nikmartin)
  2987. * tests; refactor 1703
  2988. * tests; add test generator
  2989. * tests; validate formatMessage() throws
  2990. * tests; add script for continuously running tests
  2991. * tests; fixed versioning tests
  2992. * tests; race conditions in tests
  2993. * tests; added for nested and/or queries
  2994. * tests; close some test connections
  2995. * tests; validate db contents
  2996. * tests; remove .only
  2997. * tests; close some test connections
  2998. * tests; validate db contents
  2999. * tests; remove .only
  3000. * tests; replace deprecated method names
  3001. * tests; convert id to string
  3002. * tests; fix sharding tests for MongoDB 2.4.5
  3003. * tests; now 4-5 seconds faster
  3004. * tests; fix race condition
  3005. * make; suppress warning msg in test
  3006. * benchmarks; updated for pull requests
  3007. * examples; improved and expanded [ebensing](https://github.com/ebensing)
  3008. 3.7.4 (unstable) / 2013-10-01
  3009. =============================
  3010. * updated; mquery to 0.3.2
  3011. * removed; mongoose.Error.DocumentError (never used)
  3012. * added; custom error msgs for built-in validators #747
  3013. * added; discriminator support #1647 #1003 [j](https://github.com/j)
  3014. * added; support disabled collection name pluralization #1350 #1707 [refack](https://github.com/refack)
  3015. * fixed; do not pluralize model names not ending with letters #1703 [refack](https://github.com/refack)
  3016. * fixed; repopulating modified populated paths #1697
  3017. * fixed; doc.equals() when _id option is set to false #1687
  3018. * fixed; strict mode warnings #1686
  3019. * fixed; $near GeoJSON casting #1683
  3020. * fixed; nearSphere GeoJSON query builder
  3021. * fixed; population field selection w/ strings #1669
  3022. * docs; custom validator messages
  3023. * docs; 10gen -> MongoDB
  3024. * docs; add Date method caveats #1598
  3025. * docs; more validation details
  3026. * website; add "show code" for properties
  3027. * website; move "show code" links down
  3028. * tests; refactor 1703
  3029. * tests; add test generator
  3030. * tests; validate formatMessage() throws
  3031. 3.7.3 (unstable) / 2013-08-22
  3032. =============================
  3033. * updated; warn when using an unstable version
  3034. * updated; mquery to 0.3.1
  3035. * updated; mocha to 1.12.0
  3036. * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
  3037. * changed; no longer offically supporting node 0.6.x
  3038. * added; support for GeoJSON to Query#near [ebensing](https://github.com/ebensing)
  3039. * added; stand-alone base query support - query.toConstructor() [ebensing](https://github.com/ebensing)
  3040. * added; promise support to geoSearch #1614 [ebensing](https://github.com/ebensing)
  3041. * added; promise support for geoNear #1614 [ebensing](https://github.com/ebensing)
  3042. * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
  3043. * fixed; handle another versioning edge case #1520
  3044. * fixed; excluding subdocument fields #1280 [ebensing](https://github.com/ebensing)
  3045. * fixed; allow array properties to be set to null with findOneAndUpdate [aheuermann](https://github.com/aheuermann)
  3046. * fixed; subdocuments now use own toJSON opts #1376 [ebensing](https://github.com/ebensing)
  3047. * fixed; model#geoNear fulfills promise when results empty #1658 [ebensing](https://github.com/ebensing)
  3048. * fixed; utils.merge no longer overrides props and methods #1655 [j](https://github.com/j)
  3049. * fixed; subdocuments now use their own transform #1412 [ebensing](https://github.com/ebensing)
  3050. * make; suppress warning msg in test
  3051. * docs; state which branch is stable/unstable
  3052. * docs; mention that middleware does not run on Models
  3053. * tests; add script for continuously running tests
  3054. * tests; fixed versioning tests
  3055. * benchmarks; updated for pull requests
  3056. 3.7.2 (unstable) / 2013-08-15
  3057. ==================
  3058. * fixed; model.remove() removes only what is necessary #1649
  3059. * fixed; update() now only runs with cb or explicit true #1644
  3060. * tests; race conditions in tests
  3061. * website; update guide
  3062. 3.7.1 (unstable) / 2013-08-13
  3063. =============================
  3064. * updated; driver to 1.3.18 (fixes memory leak)
  3065. * added; connection.useDb() #1124 [ebensing](https://github.com/ebensing)
  3066. * added; promise support to model.mapReduce()
  3067. * added; promise support to model.ensureIndexes()
  3068. * added; promise support to model.populate()
  3069. * fixed; casting ref docs on creation #1606 [ebensing](https://github.com/ebensing)
  3070. * fixed; model.update "overwrite" option works as documented
  3071. * fixed; query#remove() works as documented
  3072. * fixed; "limit" correctly applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
  3073. * fixed; issue with positional operator on ref docs #1572 [ebensing](https://github.com/ebensing)
  3074. * fixed; benchmarks to actually output valid json
  3075. * tests; added for nested and/or queries
  3076. * tests; close some test connections
  3077. * tests; validate db contents
  3078. * tests; remove .only
  3079. * tests; close some test connections
  3080. * tests; validate db contents
  3081. * tests; remove .only
  3082. * tests; replace deprecated method names
  3083. * tests; convert id to string
  3084. * docs; promise.fulfill()
  3085. 3.7.0 (unstable) / 2013-08-05
  3086. ===================
  3087. * changed; query.within getter is now a method -> query.within()
  3088. * changed; query.intersects getter is now a method -> query.intersects()
  3089. * deprecated; promise#addBack (use promise#onResolve)
  3090. * deprecated; promise#complete (use promise#fulfill)
  3091. * deprecated; promise#addCallback (use promise#onFulFill)
  3092. * deprecated; promise#addErrback (use promise#onReject)
  3093. * deprecated; query.nearSphere() (use query.near)
  3094. * deprecated; query.center() (use query.circle)
  3095. * deprecated; query.centerSphere() (use query.circle)
  3096. * deprecated; query#slaveOk (use query#read)
  3097. * removed; namedscope (undocumented and broken) #679 #642 #455 #379
  3098. * added; benchmarks [ebensing](https://github.com/ebensing)
  3099. * added; publicly exposed connection states #1585
  3100. * added; $geoWithin support #1529 $1455 [ebensing](https://github.com/ebensing)
  3101. * added; query method chain validation
  3102. * added; model.update `overwrite` option
  3103. * added; model.geoNear() support #1563 [ebensing](https://github.com/ebensing)
  3104. * added; model.geoSearch() support #1560 [ebensing](https://github.com/ebensing)
  3105. * added; MongooseBuffer#subtype()
  3106. * added; model.create() now returns a promise #1340
  3107. * added; support for `awaitdata` query option
  3108. * added; pass the doc to doc.remove() callback #1419 [JoeWagner](https://github.com/JoeWagner)
  3109. * added; aggregation query builder #1404 [njoyard](https://github.com/njoyard)
  3110. * updated; integrate mquery #1562 [ebensing](https://github.com/ebensing)
  3111. * updated; error msg in doc.save() #1595
  3112. * updated; bump driver to 1.3.15
  3113. * updated; mpromise 0.3.0
  3114. * updated; sliced 0.0.5
  3115. * tests; fix sharding tests for MongoDB 2.4.5
  3116. * tests; now 4-5 seconds faster
  3117. * tests; fix race condition
  3118. * docs; fix readme spelling #1483 [yorchopolis](https://github.com/yorchopolis)
  3119. * docs; fixed up the README and examples [ebensing](https://github.com/ebensing)
  3120. * website; add unstable docs
  3121. * website; many improvements
  3122. * website; fix copyright #1439
  3123. * website; server.js -> static.js #1546 [nikmartin](https://github.com/nikmartin)
  3124. * examples; improved and expanded [ebensing](https://github.com/ebensing)
  3125. 3.6.20 (stable) / 2013-09-23
  3126. ===================
  3127. * fixed; repopulating modified populated paths #1697
  3128. * fixed; doc.equals w/ _id false #1687
  3129. * fixed; strict mode warning #1686
  3130. * docs; near/nearSphere
  3131. 3.6.19 (stable) / 2013-09-04
  3132. ==================
  3133. * fixed; population field selection w/ strings #1669
  3134. * docs; Date method caveats #1598
  3135. 3.6.18 (stable) / 2013-08-22
  3136. ===================
  3137. * updated; warn when using an unstable version of mongoose
  3138. * updated; mocha to 1.12.0
  3139. * updated; mongodb driver to 1.3.19 (fix error swallowing behavior)
  3140. * fixed; setters not firing on null values #1445 [ebensing](https://github.com/ebensing)
  3141. * fixed; properly exclude subdocument fields #1280 [ebensing](https://github.com/ebensing)
  3142. * fixed; cast error in findAndModify #1643 [aheuermann](https://github.com/aheuermann)
  3143. * website; update guide
  3144. * website; added documentation for safe:false and versioning interaction
  3145. * docs; mention that middleware dont run on Models
  3146. * docs; fix indexes link
  3147. * make; suppress warning msg in test
  3148. * tests; moar
  3149. 3.6.17 / 2013-08-13
  3150. ===================
  3151. * updated; driver to 1.3.18 (fixes memory leak)
  3152. * fixed; casting ref docs on creation #1606
  3153. * docs; query options
  3154. 3.6.16 / 2013-08-08
  3155. ===================
  3156. * added; publicly expose connection states #1585
  3157. * fixed; limit applies to individual items on population #1490 [ebensing](https://github.com/ebensing)
  3158. * fixed; positional operator casting in updates #1572 [ebensing](https://github.com/ebensing)
  3159. * updated; MongoDB driver to 1.3.17
  3160. * updated; sliced to 0.0.5
  3161. * website; tweak homepage
  3162. * tests; fixed + added
  3163. * docs; fix some examples
  3164. * docs; multi-mongos support details
  3165. * docs; auto open browser after starting static server
  3166. 3.6.15 / 2013-07-16
  3167. ==================
  3168. * added; mongos failover support #1037
  3169. * updated; make schematype return vals return self #1580
  3170. * docs; add note to model.update #571
  3171. * docs; document third param to document.save callback #1536
  3172. * tests; tweek mongos test timeout
  3173. 3.6.14 / 2013-07-05
  3174. ===================
  3175. * updated; driver to 1.3.11
  3176. * fixed; issue with findOneAndUpdate not returning null on upserts #1533 [ebensing](https://github.com/ebensing)
  3177. * fixed; missing return statement in SchemaArray#$geoIntersects() #1498 [bsrykt](https://github.com/bsrykt)
  3178. * fixed; wrong isSelected() behavior #1521 [kyano](https://github.com/kyano)
  3179. * docs; note about toObject behavior during save()
  3180. * docs; add callbacks details #1547 [nikmartin](https://github.com/nikmartin)
  3181. 3.6.13 / 2013-06-27
  3182. ===================
  3183. * fixed; calling model.distinct without conditions #1541
  3184. * fixed; regression in Query#count() #1542
  3185. * now working on 3.6.13
  3186. 3.6.12 / 2013-06-25
  3187. ===================
  3188. * updated; driver to 1.3.10
  3189. * updated; clearer capped collection error message #1509 [bitmage](https://github.com/bitmage)
  3190. * fixed; MongooseBuffer subtype loss during casting #1517 [zedgu](https://github.com/zedgu)
  3191. * fixed; docArray#id when doc.id is disabled #1492
  3192. * fixed; docArray#id now supports matches on populated arrays #1492 [pgherveou](https://github.com/pgherveou)
  3193. * website; fix example
  3194. * website; improve _id disabling example
  3195. * website; fix typo #1494 [dejj](https://github.com/dejj)
  3196. * docs; added a 'Requesting new features' section #1504 [shovon](https://github.com/shovon)
  3197. * docs; improve subtypes description
  3198. * docs; clarify _id disabling
  3199. * docs: display by alphabetical order the methods list #1508 [nicolasleger](https://github.com/nicolasleger)
  3200. * tests; refactor isSelected checks
  3201. * tests; remove pointless test
  3202. * tests; fixed timeouts
  3203. 3.6.11 / 2013-05-15
  3204. ===================
  3205. * updated; driver to 1.3.5
  3206. * fixed; compat w/ Object.create(null) #1484 #1485
  3207. * fixed; cloning objects w/ missing constructors
  3208. * fixed; prevent multiple min number validators #1481 [nrako](https://github.com/nrako)
  3209. * docs; add doc.increment() example
  3210. * docs; add $size example
  3211. * docs; add "distinct" example
  3212. 3.6.10 / 2013-05-09
  3213. ==================
  3214. * update driver to 1.3.3
  3215. * fixed; increment() works without other changes #1475
  3216. * website; fix links to posterous
  3217. * docs; fix link #1472
  3218. 3.6.9 / 2013-05-02
  3219. ==================
  3220. * fixed; depopulation of mixed documents #1471
  3221. * fixed; use of $options in array #1462
  3222. * tests; fix race condition
  3223. * docs; fix default example
  3224. 3.6.8 / 2013-04-25
  3225. ==================
  3226. * updated; driver to 1.3.0
  3227. * fixed; connection.model should retain options #1458 [vedmalex](https://github.com/vedmalex)
  3228. * tests; 4-5 seconds faster
  3229. 3.6.7 / 2013-04-19
  3230. ==================
  3231. * fixed; population regression in 3.6.6 #1444
  3232. 3.6.6 / 2013-04-18
  3233. ==================
  3234. * fixed; saving populated new documents #1442
  3235. * fixed; population regession in 3.6.5 #1441
  3236. * website; fix copyright #1439
  3237. 3.6.5 / 2013-04-15
  3238. ==================
  3239. * fixed; strict:throw edge case using .set(path, val)
  3240. * fixed; schema.pathType() on some numbericAlpha paths
  3241. * fixed; numbericAlpha path versioning
  3242. * fixed; setting nested mixed paths #1418
  3243. * fixed; setting nested objects with null prop #1326
  3244. * fixed; regression in v3.6 population performance #1426 [vedmalex](https://github.com/vedmalex)
  3245. * fixed; read pref typos #1422 [kyano](https://github.com/kyano)
  3246. * docs; fix method example
  3247. * website; update faq
  3248. * website; add more deep links
  3249. * website; update poolSize docs
  3250. * website; add 3.6 release notes
  3251. * website; note about keepAlive
  3252. 3.6.4 / 2013-04-03
  3253. ==================
  3254. * fixed; +field conflict with $slice #1370
  3255. * fixed; nested deselection conflict #1333
  3256. * fixed; RangeError in ValidationError.toString() #1296
  3257. * fixed; do not save user defined transforms #1415
  3258. * tests; fix race condition
  3259. 3.6.3 / 2013-04-02
  3260. ==================
  3261. * fixed; setting subdocuments deeply nested fields #1394
  3262. * fixed; regression: populated streams #1411
  3263. * docs; mention hooks/validation with findAndModify
  3264. * docs; mention auth
  3265. * docs; add more links
  3266. * examples; add document methods example
  3267. * website; display "see" links for properties
  3268. * website; clean up homepage
  3269. 3.6.2 / 2013-03-29
  3270. ==================
  3271. * fixed; corrupted sub-doc array #1408
  3272. * fixed; document#update returns a Query #1397
  3273. * docs; readpref strategy
  3274. 3.6.1 / 2013-03-27
  3275. ==================
  3276. * added; populate support to findAndModify varients #1395
  3277. * added; text index type to schematypes
  3278. * expose allowed index types as Schema.indexTypes
  3279. * fixed; use of `setMaxListeners` as path
  3280. * fixed; regression in node 0.6 on docs with > 10 arrays
  3281. * fixed; do not alter schema arguments #1364
  3282. * fixed; subdoc#ownerDocument() #1385
  3283. * website; change search id
  3284. * website; add search from google [jackdbernier](https://github.com/jackdbernier)
  3285. * website; fix link
  3286. * website; add 3.5.x docs release
  3287. * website; fix link
  3288. * docs; fix geometry
  3289. * docs; hide internal constructor
  3290. * docs; aggregation does not cast arguments #1399
  3291. * docs; querystream options
  3292. * examples; added for population
  3293. 3.6.0 / 2013-03-18
  3294. ==================
  3295. * changed; cast 'true'/'false' to boolean #1282 [mgrach](https://github.com/mgrach)
  3296. * changed; Buffer arrays can now contain nulls
  3297. * added; QueryStream transform option
  3298. * added; support for authSource driver option
  3299. * added; {mongoose,db}.modelNames()
  3300. * added; $push w/ $slice,$sort support (MongoDB 2.4)
  3301. * added; hashed index type (MongoDB 2.4)
  3302. * added; support for mongodb 2.4 geojson (MongoDB 2.4)
  3303. * added; value at time of validation error
  3304. * added; support for object literal schemas
  3305. * added; bufferCommands schema option
  3306. * added; allow auth option in connections #1360 [geoah](https://github.com/geoah)
  3307. * added; performance improvements to populate() [263ece9](https://github.com/LearnBoost/mongoose/commit/263ece9)
  3308. * added; allow adding uncasted docs to populated arrays and properties #570
  3309. * added; doc#populated(path) stores original populated _ids
  3310. * added; lean population #1260
  3311. * added; query.populate() now accepts an options object
  3312. * added; document#populate(opts, callback)
  3313. * added; Model.populate(docs, opts, callback)
  3314. * added; support for rich nested path population
  3315. * added; doc.array.remove(value) subdoc with _id value support #1278
  3316. * added; optionally allow non-strict sets and updates
  3317. * added; promises/A+ comformancy with [mpromise](https://github.com/aheckmann/mpromise)
  3318. * added; promise#then
  3319. * added; promise#end
  3320. * fixed; use of `model` as doc property
  3321. * fixed; lean population #1382
  3322. * fixed; empty object mixed defaults #1380
  3323. * fixed; populate w/ deselected _id using string syntax
  3324. * fixed; attempted save of divergent populated arrays #1334 related
  3325. * fixed; better error msg when attempting toObject as property name
  3326. * fixed; non population buffer casting from doc
  3327. * fixed; setting populated paths #570
  3328. * fixed; casting when added docs to populated arrays #570
  3329. * fixed; prohibit updating arrays selected with $elemMatch #1334
  3330. * fixed; pull / set subdoc combination #1303
  3331. * fixed; multiple bg index creation #1365
  3332. * fixed; manual reconnection to single mongod
  3333. * fixed; Constructor / version exposure #1124
  3334. * fixed; CastError race condition
  3335. * fixed; no longer swallowing misuse of subdoc#invalidate()
  3336. * fixed; utils.clone retains RegExp opts
  3337. * fixed; population of non-schema property
  3338. * fixed; allow updating versionKey #1265
  3339. * fixed; add EventEmitter props to reserved paths #1338
  3340. * fixed; can now deselect populated doc _ids #1331
  3341. * fixed; properly pass subtype to Binary in MongooseBuffer
  3342. * fixed; casting _id from document with non-ObjectId _id
  3343. * fixed; specifying schema type edge case { path: [{type: "String" }] }
  3344. * fixed; typo in schemdate #1329 [jplock](https://github.com/jplock)
  3345. * updated; driver to 1.2.14
  3346. * updated; muri to 0.3.1
  3347. * updated; mpromise to 0.2.1
  3348. * updated; mocha 1.8.1
  3349. * updated; mpath to 0.1.1
  3350. * deprecated; pluralization will die in 4.x
  3351. * refactor; rename private methods to something unusable as doc properties
  3352. * refactor MongooseArray#remove
  3353. * refactor; move expires index to SchemaDate #1328
  3354. * refactor; internal document properties #1171 #1184
  3355. * tests; added
  3356. * docs; indexes
  3357. * docs; validation
  3358. * docs; populate
  3359. * docs; populate
  3360. * docs; add note about stream compatibility with node 0.8
  3361. * docs; fix for private names
  3362. * docs; Buffer -> mongodb.Binary #1363
  3363. * docs; auth options
  3364. * docs; improved
  3365. * website; update FAQ
  3366. * website; add more api links
  3367. * website; add 3.5.x docs to prior releases
  3368. * website; Change mongoose-types to an active repo [jackdbernier](https://github.com/jackdbernier)
  3369. * website; compat with node 0.10
  3370. * website; add news section
  3371. * website; use T for generic type
  3372. * benchmark; make adjustable
  3373. 3.6.0rc1 / 2013-03-12
  3374. ======================
  3375. * refactor; rename private methods to something unusable as doc properties
  3376. * added; {mongoose,db}.modelNames()
  3377. * added; $push w/ $slice,$sort support (MongoDB 2.4)
  3378. * added; hashed index type (MongoDB 2.4)
  3379. * added; support for mongodb 2.4 geojson (MongoDB 2.4)
  3380. * added; value at time of validation error
  3381. * added; support for object literal schemas
  3382. * added; bufferCommands schema option
  3383. * added; allow auth option in connections #1360 [geoah](https://github.com/geoah)
  3384. * fixed; lean population #1382
  3385. * fixed; empty object mixed defaults #1380
  3386. * fixed; populate w/ deselected _id using string syntax
  3387. * fixed; attempted save of divergent populated arrays #1334 related
  3388. * fixed; better error msg when attempting toObject as property name
  3389. * fixed; non population buffer casting from doc
  3390. * fixed; setting populated paths #570
  3391. * fixed; casting when added docs to populated arrays #570
  3392. * fixed; prohibit updating arrays selected with $elemMatch #1334
  3393. * fixed; pull / set subdoc combination #1303
  3394. * fixed; multiple bg index creation #1365
  3395. * fixed; manual reconnection to single mongod
  3396. * fixed; Constructor / version exposure #1124
  3397. * fixed; CastError race condition
  3398. * fixed; no longer swallowing misuse of subdoc#invalidate()
  3399. * fixed; utils.clone retains RegExp opts
  3400. * fixed; population of non-schema property
  3401. * fixed; allow updating versionKey #1265
  3402. * fixed; add EventEmitter props to reserved paths #1338
  3403. * fixed; can now deselect populated doc _ids #1331
  3404. * updated; muri to 0.3.1
  3405. * updated; driver to 1.2.12
  3406. * updated; mpromise to 0.2.1
  3407. * deprecated; pluralization will die in 4.x
  3408. * docs; Buffer -> mongodb.Binary #1363
  3409. * docs; auth options
  3410. * docs; improved
  3411. * website; add news section
  3412. * benchmark; make adjustable
  3413. 3.6.0rc0 / 2013-02-03
  3414. ======================
  3415. * changed; cast 'true'/'false' to boolean #1282 [mgrach](https://github.com/mgrach)
  3416. * changed; Buffer arrays can now contain nulls
  3417. * fixed; properly pass subtype to Binary in MongooseBuffer
  3418. * fixed; casting _id from document with non-ObjectId _id
  3419. * fixed; specifying schema type edge case { path: [{type: "String" }] }
  3420. * fixed; typo in schemdate #1329 [jplock](https://github.com/jplock)
  3421. * refactor; move expires index to SchemaDate #1328
  3422. * refactor; internal document properties #1171 #1184
  3423. * added; performance improvements to populate() [263ece9](https://github.com/LearnBoost/mongoose/commit/263ece9)
  3424. * added; allow adding uncasted docs to populated arrays and properties #570
  3425. * added; doc#populated(path) stores original populated _ids
  3426. * added; lean population #1260
  3427. * added; query.populate() now accepts an options object
  3428. * added; document#populate(opts, callback)
  3429. * added; Model.populate(docs, opts, callback)
  3430. * added; support for rich nested path population
  3431. * added; doc.array.remove(value) subdoc with _id value support #1278
  3432. * added; optionally allow non-strict sets and updates
  3433. * added; promises/A+ comformancy with [mpromise](https://github.com/aheckmann/mpromise)
  3434. * added; promise#then
  3435. * added; promise#end
  3436. * updated; mocha 1.8.1
  3437. * updated; muri to 0.3.0
  3438. * updated; mpath to 0.1.1
  3439. * updated; docs
  3440. 3.5.16 / 2013-08-13
  3441. ===================
  3442. * updated; driver to 1.3.18
  3443. 3.5.15 / 2013-07-26
  3444. ==================
  3445. * updated; sliced to 0.0.5
  3446. * updated; driver to 1.3.12
  3447. * fixed; regression in Query#count() due to driver change
  3448. * tests; fixed timeouts
  3449. * tests; handle differing test uris
  3450. 3.5.14 / 2013-05-15
  3451. ===================
  3452. * updated; driver to 1.3.5
  3453. * fixed; compat w/ Object.create(null) #1484 #1485
  3454. * fixed; cloning objects missing constructors
  3455. * fixed; prevent multiple min number validators #1481 [nrako](https://github.com/nrako)
  3456. 3.5.13 / 2013-05-09
  3457. ==================
  3458. * update driver to 1.3.3
  3459. * fixed; use of $options in array #1462
  3460. 3.5.12 / 2013-04-25
  3461. ===================
  3462. * updated; driver to 1.3.0
  3463. * fixed; connection.model should retain options #1458 [vedmalex](https://github.com/vedmalex)
  3464. * fixed; read pref typos #1422 [kyano](https://github.com/kyano)
  3465. 3.5.11 / 2013-04-03
  3466. ==================
  3467. * fixed; +field conflict with $slice #1370
  3468. * fixed; RangeError in ValidationError.toString() #1296
  3469. * fixed; nested deselection conflict #1333
  3470. * remove time from Makefile
  3471. 3.5.10 / 2013-04-02
  3472. ==================
  3473. * fixed; setting subdocuments deeply nested fields #1394
  3474. * fixed; do not alter schema arguments #1364
  3475. 3.5.9 / 2013-03-15
  3476. ==================
  3477. * updated; driver to 1.2.14
  3478. * added; support for authSource driver option (mongodb 2.4)
  3479. * added; QueryStream transform option (node 0.10 helper)
  3480. * fixed; backport for saving required populated buffers
  3481. * fixed; pull / set subdoc combination #1303
  3482. * fixed; multiple bg index creation #1365
  3483. * test; added for saveable required populated buffers
  3484. * test; added for #1365
  3485. * test; add authSource test
  3486. 3.5.8 / 2013-03-12
  3487. ==================
  3488. * added; auth option in connection [geoah](https://github.com/geoah)
  3489. * fixed; CastError race condition
  3490. * docs; add note about stream compatibility with node 0.8
  3491. 3.5.7 / 2013-02-22
  3492. ==================
  3493. * updated; driver to 1.2.13
  3494. * updated; muri to 0.3.1 #1347
  3495. * fixed; utils.clone retains RegExp opts #1355
  3496. * fixed; deepEquals RegExp support
  3497. * tests; fix a connection test
  3498. * website; clean up docs [afshinm](https://github.com/afshinm)
  3499. * website; update homepage
  3500. * website; migragtion: emphasize impact of strict docs #1264
  3501. 3.5.6 / 2013-02-14
  3502. ==================
  3503. * updated; driver to 1.2.12
  3504. * fixed; properly pass Binary subtype
  3505. * fixed; add EventEmitter props to reserved paths #1338
  3506. * fixed; use correct node engine version
  3507. * fixed; display empty docs as {} in log output #953 follow up
  3508. * improved; "bad $within $box argument" error message
  3509. * populate; add unscientific benchmark
  3510. * website; add stack overflow to help section
  3511. * website; use better code font #1336 [risseraka](https://github.com/risseraka)
  3512. * website; clarify where help is available
  3513. * website; fix source code links #1272 [floatingLomas](https://github.com/floatingLomas)
  3514. * docs; be specific about _id schema option #1103
  3515. * docs; add ensureIndex error handling example
  3516. * docs; README
  3517. * docs; CONTRIBUTING.md
  3518. 3.5.5 / 2013-01-29
  3519. ==================
  3520. * updated; driver to 1.2.11
  3521. * removed; old node < 0.6x shims
  3522. * fixed; documents with Buffer _ids equality
  3523. * fixed; MongooseBuffer properly casts numbers
  3524. * fixed; reopening closed connection on alt host/port #1287
  3525. * docs; fixed typo in Readme #1298 [rened](https://github.com/rened)
  3526. * docs; fixed typo in migration docs [Prinzhorn](https://github.com/Prinzhorn)
  3527. * docs; fixed incorrect annotation in SchemaNumber#min [bilalq](https://github.com/bilalq)
  3528. * docs; updated
  3529. 3.5.4 / 2013-01-07
  3530. ==================
  3531. * changed; "_pres" & "_posts" are now reserved pathnames #1261
  3532. * updated; driver to 1.2.8
  3533. * fixed; exception when reopening a replica set. #1263 [ethankan](https://github.com/ethankan)
  3534. * website; updated
  3535. 3.5.3 / 2012-12-26
  3536. ==================
  3537. * added; support for geo object notation #1257
  3538. * fixed; $within query casting with arrays
  3539. * fixed; unix domain socket support #1254
  3540. * updated; driver to 1.2.7
  3541. * updated; muri to 0.0.5
  3542. 3.5.2 / 2012-12-17
  3543. ==================
  3544. * fixed; using auth with replica sets #1253
  3545. 3.5.1 / 2012-12-12
  3546. ==================
  3547. * fixed; regression when using subdoc with `path` as pathname #1245 [daeq](https://github.com/daeq)
  3548. * fixed; safer db option checks
  3549. * updated; driver to 1.2.5
  3550. * website; add more examples
  3551. * website; clean up old docs
  3552. * website; fix prev release urls
  3553. * docs; clarify streaming with HTTP responses
  3554. 3.5.0 / 2012-12-10
  3555. ==================
  3556. * added; paths to CastErrors #1239
  3557. * added; support for mongodb connection string spec #1187
  3558. * added; post validate event
  3559. * added; Schema#get (to retrieve schema options)
  3560. * added; VersionError #1071
  3561. * added; npmignore [hidekiy](https://github.com/hidekiy)
  3562. * update; driver to 1.2.3
  3563. * fixed; stackoverflow in setter #1234
  3564. * fixed; utils.isObject()
  3565. * fixed; do not clobber user specified driver writeConcern #1227
  3566. * fixed; always pass current document to post hooks
  3567. * fixed; throw error when user attempts to overwrite a model
  3568. * fixed; connection.model only caches on connection #1209
  3569. * fixed; respect conn.model() creation when matching global model exists #1209
  3570. * fixed; passing model name + collection name now always honors collection name
  3571. * fixed; setting virtual field to an empty object #1154
  3572. * fixed; subclassed MongooseErrors exposure, now available in mongoose.Error.xxxx
  3573. * fixed; model.remove() ignoring callback when executed twice [daeq](https://github.com/daeq) #1210
  3574. * docs; add collection option to schema api docs #1222
  3575. * docs; NOTE about db safe options
  3576. * docs; add post hooks docs
  3577. * docs; connection string options
  3578. * docs; middleware is not executed with Model.remove #1241
  3579. * docs; {g,s}etter introspection #777
  3580. * docs; update validation docs
  3581. * docs; add link to plugins page
  3582. * docs; clarify error returned by unique indexes #1225
  3583. * docs; more detail about disabling autoIndex behavior
  3584. * docs; add homepage section to package (npm docs mongoose)
  3585. * docs; more detail around collection name pluralization #1193
  3586. * website; add .important css
  3587. * website; update models page
  3588. * website; update getting started
  3589. * website; update quick start
  3590. 3.4.0 / 2012-11-10
  3591. ==================
  3592. * added; support for generic toJSON/toObject transforms #1160 #1020 #1197
  3593. * added; doc.set() merge support #1148 [NuORDER](https://github.com/NuORDER)
  3594. * added; query#add support #1188 [aleclofabbro](https://github.com/aleclofabbro)
  3595. * changed; adding invalid nested paths to non-objects throws 4216f14
  3596. * changed; fixed; stop invalid function cloning (internal fix)
  3597. * fixed; add query $and casting support #1180 [anotheri](https://github.com/anotheri)
  3598. * fixed; overwriting of query arguments #1176
  3599. * docs; fix expires examples
  3600. * docs; transforms
  3601. * docs; schema `collection` option docs [hermanjunge](https://github.com/hermanjunge)
  3602. * website; updated
  3603. * tests; added
  3604. 3.3.1 / 2012-10-11
  3605. ==================
  3606. * fixed; allow goose.connect(uris, dbname, opts) #1144
  3607. * docs; persist API private checked state across page loads
  3608. 3.3.0 / 2012-10-10
  3609. ==================
  3610. * fixed; passing options as 2nd arg to connect() #1144
  3611. * fixed; race condition after no-op save #1139
  3612. * fixed; schema field selection application in findAndModify #1150
  3613. * fixed; directly setting arrays #1126
  3614. * updated; driver to 1.1.11
  3615. * updated; collection pluralization rules [mrickard](https://github.com/mrickard)
  3616. * tests; added
  3617. * docs; updated
  3618. 3.2.2 / 2012-10-08
  3619. ==================
  3620. * updated; driver to 1.1.10 #1143
  3621. * updated; use sliced 0.0.3
  3622. * fixed; do not recast embedded docs unnecessarily
  3623. * fixed; expires schema option helper #1132
  3624. * fixed; built in string setters #1131
  3625. * fixed; debug output for Dates/ObjectId properties #1129
  3626. * docs; fixed Javascript syntax error in example [olalonde](https://github.com/olalonde)
  3627. * docs; fix toJSON example #1137
  3628. * docs; add ensureIndex production notes
  3629. * docs; fix spelling
  3630. * docs; add blogposts about v3
  3631. * website; updated
  3632. * removed; undocumented inGroupsOf util
  3633. * tests; added
  3634. 3.2.1 / 2012-09-28
  3635. ==================
  3636. * fixed; remove query batchSize option default of 1000 https://github.com/learnboost/mongoose/commit/3edaa8651
  3637. * docs; updated
  3638. * website; updated
  3639. 3.2.0 / 2012-09-27
  3640. ==================
  3641. * added; direct array index assignment with casting support `doc.array.set(index, value)`
  3642. * fixed; QueryStream#resume within same tick as pause() #1116
  3643. * fixed; default value validatation #1109
  3644. * fixed; array splice() not casting #1123
  3645. * fixed; default array construction edge case #1108
  3646. * fixed; query casting for inequalities in arrays #1101 [dpatti](https://github.com/dpatti)
  3647. * tests; added
  3648. * website; more documentation
  3649. * website; fixed layout issue #1111 [SlashmanX](https://github.com/SlashmanX)
  3650. * website; refactored [guille](https://github.com/guille)
  3651. 3.1.2 / 2012-09-10
  3652. ==================
  3653. * added; ReadPreferrence schema option #1097
  3654. * updated; driver to 1.1.7
  3655. * updated; default query batchSize to 1000
  3656. * fixed; we now cast the mapReduce query option #1095
  3657. * fixed; $elemMatch+$in with field selection #1091
  3658. * fixed; properly cast $elemMatch+$in conditions #1100
  3659. * fixed; default field application of subdocs #1027
  3660. * fixed; querystream prematurely dying #1092
  3661. * fixed; querystream never resumes when paused at getMore boundries #1092
  3662. * fixed; querystream occasionally emits data events after destroy #1092
  3663. * fixed; remove unnecessary ObjectId creation in querystream
  3664. * fixed; allow ne(boolean) again #1093
  3665. * docs; add populate/field selection syntax notes
  3666. * docs; add toObject/toJSON options detail
  3667. * docs; `read` schema option
  3668. 3.1.1 / 2012-08-31
  3669. ==================
  3670. * updated; driver to 1.1.6
  3671. 3.1.0 / 2012-08-29
  3672. ==================
  3673. * changed; fixed; directly setting nested objects now overwrites entire object (previously incorrectly merged them)
  3674. * added; read pref support (mongodb 2.2) 205a709c
  3675. * added; aggregate support (mongodb 2.2) f3a5bd3d
  3676. * added; virtual {g,s}etter introspection (#1070)
  3677. * updated; docs [brettz9](https://github.com/brettz9)
  3678. * updated; driver to 1.1.5
  3679. * fixed; retain virtual setter return values (#1069)
  3680. 3.0.3 / 2012-08-23
  3681. ==================
  3682. * fixed; use of nested paths beginning w/ numbers #1062
  3683. * fixed; query population edge case #1053 #1055 [jfremy](https://github.com/jfremy)
  3684. * fixed; simultaneous top and sub level array modifications #1073
  3685. * added; id and _id schema option aliases + tests
  3686. * improve debug formatting to allow copy/paste logged queries into mongo shell [eknkc](https://github.com/eknkc)
  3687. * docs
  3688. 3.0.2 / 2012-08-17
  3689. ==================
  3690. * added; missing support for v3 sort/select syntax to findAndModify helpers (#1058)
  3691. * fixed; replset fullsetup event emission
  3692. * fixed; reconnected event for replsets
  3693. * fixed; server reconnection setting discovery
  3694. * fixed; compat with non-schema path props using positional notation (#1048)
  3695. * fixed; setter/casting order (#665)
  3696. * docs; updated
  3697. 3.0.1 / 2012-08-11
  3698. ==================
  3699. * fixed; throw Error on bad validators (1044)
  3700. * fixed; typo in EmbeddedDocument#parentArray [lackac]
  3701. * fixed; repair mongoose.SchemaTypes alias
  3702. * updated; docs
  3703. 3.0.0 / 2012-08-07
  3704. ==================
  3705. * removed; old subdocument#commit method
  3706. * fixed; setting arrays of matching docs [6924cbc2]
  3707. * fixed; doc!remove event now emits in save order as save for consistency
  3708. * fixed; pre-save hooks no longer fire on subdocuments when validation fails
  3709. * added; subdoc#parent() and subdoc#parentArray() to access subdocument parent objects
  3710. * added; query#lean() helper
  3711. 3.0.0rc0 / 2012-08-01
  3712. =====================
  3713. * fixed; allow subdoc literal declarations containing "type" pathname (#993)
  3714. * fixed; unsetting a default array (#758)
  3715. * fixed; boolean $in queries (#998)
  3716. * fixed; allow use of `options` as a pathname (#529)
  3717. * fixed; `model` is again a permitted schema path name
  3718. * fixed; field selection option on subdocs (#1022)
  3719. * fixed; handle another edge case with subdoc saving (#975)
  3720. * added; emit save err on model if listening
  3721. * added; MongoDB TTL collection support (#1006)
  3722. * added; $center options support
  3723. * added; $nearSphere and $polygon support
  3724. * updated; driver version to 1.1.2
  3725. 3.0.0alpha2 / 2012-07-18
  3726. =========================
  3727. * changed; index errors are now emitted on their model and passed to an optional callback (#984)
  3728. * fixed; specifying index along with sparse/unique option no longer overwrites (#1004)
  3729. * fixed; never swallow connection errors (#618)
  3730. * fixed; creating object from model with emded object no longer overwrites defaults [achurkin] (#859)
  3731. * fixed; stop needless validation of unchanged/unselected fields (#891)
  3732. * fixed; document#equals behavior of objectids (#974)
  3733. * fixed; honor the minimize schema option (#978)
  3734. * fixed; provide helpful error msgs when reserved schema path is used (#928)
  3735. * fixed; callback to conn#disconnect is optional (#875)
  3736. * fixed; handle missing protocols in connection urls (#987)
  3737. * fixed; validate args to query#where (#969)
  3738. * fixed; saving modified/removed subdocs (#975)
  3739. * fixed; update with $pull from Mixed array (#735)
  3740. * fixed; error with null shard key value
  3741. * fixed; allow unsetting enums (#967)
  3742. * added; support for manual index creation (#984)
  3743. * added; support for disabled auto-indexing (#984)
  3744. * added; support for preserving MongooseArray#sort changes (#752)
  3745. * added; emit state change events on connection
  3746. * added; support for specifying BSON subtype in MongooseBuffer#toObject [jcrugzz]
  3747. * added; support for disabled versioning (#977)
  3748. * added; implicit "new" support for models and Schemas
  3749. 3.0.0alpha1 / 2012-06-15
  3750. =========================
  3751. * removed; doc#commit (use doc#markModified)
  3752. * removed; doc.modified getter (#950)
  3753. * removed; mongoose{connectSet,createSetConnection}. use connect,createConnection instead
  3754. * removed; query alias methods 1149804c
  3755. * removed; MongooseNumber
  3756. * changed; now creating indexes in background by default
  3757. * changed; strict mode now enabled by default (#952)
  3758. * changed; doc#modifiedPaths is now a method (#950)
  3759. * changed; getters no longer cast (#820); casting happens during set
  3760. * fixed; no need to pass updateArg to findOneAndUpdate (#931)
  3761. * fixed: utils.merge bug when merging nested non-objects. [treygriffith]
  3762. * fixed; strict:throw should produce errors in findAndModify (#963)
  3763. * fixed; findAndUpdate no longer overwrites document (#962)
  3764. * fixed; setting default DocumentArrays (#953)
  3765. * fixed; selection of _id with schema deselection (#954)
  3766. * fixed; ensure promise#error emits instanceof Error
  3767. * fixed; CursorStream: No stack overflow on any size result (#929)
  3768. * fixed; doc#remove now passes safe options
  3769. * fixed; invalid use of $set during $pop
  3770. * fixed; array#{$pop,$shift} mirror MongoDB behavior
  3771. * fixed; no longer test non-required vals in string match (#934)
  3772. * fixed; edge case with doc#inspect
  3773. * fixed; setter order (#665)
  3774. * fixed; setting invalid paths in strict mode (#916)
  3775. * fixed; handle docs without id in DocumentArray#id method (#897)
  3776. * fixed; do not save virtuals during model.update (#894)
  3777. * fixed; sub doc toObject virtuals application (#889)
  3778. * fixed; MongooseArray#pull of ObjectId (#881)
  3779. * fixed; handle passing db name with any repl set string
  3780. * fixed; default application of selected fields (#870)
  3781. * fixed; subdoc paths reported in validation errors (#725)
  3782. * fixed; incorrect reported num of affected docs in update ops (#862)
  3783. * fixed; connection assignment in Model#model (#853)
  3784. * fixed; stringifying arrays of docs (#852)
  3785. * fixed; modifying subdoc and parent array works (#842)
  3786. * fixed; passing undefined to next hook (#785)
  3787. * fixed; Query#{update,remove}() works without callbacks (#788)
  3788. * fixed; set/updating nested objects by parent pathname (#843)
  3789. * fixed; allow null in number arrays (#840)
  3790. * fixed; isNew on sub doc after insertion error (#837)
  3791. * fixed; if an insert fails, set isNew back to false [boutell]
  3792. * fixed; isSelected when only _id is selected (#730)
  3793. * fixed; setting an unset default value (#742)
  3794. * fixed; query#sort error messaging (#671)
  3795. * fixed; support for passing $options with $regex
  3796. * added; array of object literal notation in schema creates DocumentArrays
  3797. * added; gt,gte,lt,lte query support for arrays (#902)
  3798. * added; capped collection support (#938)
  3799. * added; document versioning support
  3800. * added; inclusion of deselected schema path (#786)
  3801. * added; non-atomic array#pop
  3802. * added; EmbeddedDocument constructor is now exposed in DocArray#create 7cf8beec
  3803. * added; mapReduce support (#678)
  3804. * added; support for a configurable minimize option #to{Object,JSON}(option) (#848)
  3805. * added; support for strict: `throws` [regality]
  3806. * added; support for named schema types (#795)
  3807. * added; to{Object,JSON} schema options (#805)
  3808. * added; findByIdAnd{Update,Remove}()
  3809. * added; findOneAnd{Update,Remove}()
  3810. * added; query.setOptions()
  3811. * added; instance.update() (#794)
  3812. * added; support specifying model in populate() [DanielBaulig]
  3813. * added; `lean` query option [gitfy]
  3814. * added; multi-atomic support to MongooseArray#nonAtomicPush
  3815. * added; support for $set + other $atomic ops on single array
  3816. * added; tests
  3817. * updated; driver to 1.0.2
  3818. * updated; query.sort() syntax to mirror query.select()
  3819. * updated; clearer cast error msg for array numbers
  3820. * updated; docs
  3821. * updated; doc.clone 3x faster (#950)
  3822. * updated; only create _id if necessary (#950)
  3823. 2.7.3 / 2012-08-01
  3824. ==================
  3825. * fixed; boolean $in queries (#998)
  3826. * fixed field selection option on subdocs (#1022)
  3827. 2.7.2 / 2012-07-18
  3828. ==================
  3829. * fixed; callback to conn#disconnect is optional (#875)
  3830. * fixed; handle missing protocols in connection urls (#987)
  3831. * fixed; saving modified/removed subdocs (#975)
  3832. * updated; tests
  3833. 2.7.1 / 2012-06-26
  3834. ===================
  3835. * fixed; sharding: when a document holds a null as a value of the shard key
  3836. * fixed; update() using $pull on an array of Mixed (gh-735)
  3837. * deprecated; MongooseNumber#{inc, increment, decrement} methods
  3838. * tests; now using mocha
  3839. 2.7.0 / 2012-06-14
  3840. ===================
  3841. * added; deprecation warnings to methods being removed in 3.x
  3842. 2.6.8 / 2012-06-14
  3843. ===================
  3844. * fixed; edge case when using 'options' as a path name (#961)
  3845. 2.6.7 / 2012-06-08
  3846. ===================
  3847. * fixed; ensure promise#error always emits instanceof Error
  3848. * fixed; selection of _id w/ another excluded path (#954)
  3849. * fixed; setting default DocumentArrays (#953)
  3850. 2.6.6 / 2012-06-06
  3851. ===================
  3852. * fixed; stack overflow in query stream with large result sets (#929)
  3853. * added; $gt, $gte, $lt, $lte support to arrays (#902)
  3854. * fixed; pass option `safe` along to doc#remove() calls
  3855. 2.6.5 / 2012-05-24
  3856. ===================
  3857. * fixed; do not save virtuals in Model.update (#894)
  3858. * added; missing $ prefixed query aliases (going away in 3.x) (#884) [timoxley]
  3859. * fixed; setting invalid paths in strict mode (#916)
  3860. * fixed; resetting isNew after insert failure (#837) [boutell]
  3861. 2.6.4 / 2012-05-15
  3862. ===================
  3863. * updated; backport string regex $options to 2.x
  3864. * updated; use driver 1.0.2 (performance improvements) (#914)
  3865. * fixed; calling MongooseDocumentArray#id when the doc has no _id (#897)
  3866. 2.6.3 / 2012-05-03
  3867. ===================
  3868. * fixed; repl-set connectivity issues during failover on MongoDB 2.0.1
  3869. * updated; driver to 1.0.0
  3870. * fixed; virtuals application of subdocs when using toObject({ virtuals: true }) (#889)
  3871. * fixed; MongooseArray#pull of ObjectId correctly updates the array itself (#881)
  3872. 2.6.2 / 2012-04-30
  3873. ===================
  3874. * fixed; default field application of selected fields (#870)
  3875. 2.6.1 / 2012-04-30
  3876. ===================
  3877. * fixed; connection assignment in mongoose#model (#853, #877)
  3878. * fixed; incorrect reported num of affected docs in update ops (#862)
  3879. 2.6.0 / 2012-04-19
  3880. ===================
  3881. * updated; hooks.js to 0.2.1
  3882. * fixed; issue with passing undefined to a hook callback. thanks to [chrisleishman] for reporting.
  3883. * fixed; updating/setting nested objects in strict schemas (#843) as reported by [kof]
  3884. * fixed; Query#{update,remove}() work without callbacks again (#788)
  3885. * fixed; modifying subdoc along with parent array $atomic op (#842)
  3886. 2.5.14 / 2012-04-13
  3887. ===================
  3888. * fixed; setting an unset default value (#742)
  3889. * fixed; doc.isSelected(otherpath) when only _id is selected (#730)
  3890. * updated; docs
  3891. 2.5.13 / 2012-03-22
  3892. ===================
  3893. * fixed; failing validation of unselected required paths (#730,#713)
  3894. * fixed; emitting connection error when only one listener (#759)
  3895. * fixed; MongooseArray#splice was not returning values (#784) [chrisleishman]
  3896. 2.5.12 / 2012-03-21
  3897. ===================
  3898. * fixed; honor the `safe` option in all ensureIndex calls
  3899. * updated; node-mongodb-native driver to 0.9.9-7
  3900. 2.5.11 / 2012-03-15
  3901. ===================
  3902. * added; introspection for getters/setters (#745)
  3903. * updated; node-mongodb-driver to 0.9.9-5
  3904. * added; tailable method to Query (#769) [holic]
  3905. * fixed; Number min/max validation of null (#764) [btamas]
  3906. * added; more flexible user/password connection options (#738) [KarneAsada]
  3907. 2.5.10 / 2012-03-06
  3908. ===================
  3909. * updated; node-mongodb-native driver to 0.9.9-4
  3910. * added; Query#comment()
  3911. * fixed; allow unsetting arrays
  3912. * fixed; hooking the set method of subdocuments (#746)
  3913. * fixed; edge case in hooks
  3914. * fixed; allow $id and $ref in queries (fixes compatibility with mongoose-dbref) (#749) [richtera]
  3915. * added; default path selection to SchemaTypes
  3916. 2.5.9 / 2012-02-22
  3917. ===================
  3918. * fixed; properly cast nested atomic update operators for sub-documents
  3919. 2.5.8 / 2012-02-21
  3920. ===================
  3921. * added; post 'remove' middleware includes model that was removed (#729) [timoxley]
  3922. 2.5.7 / 2012-02-09
  3923. ===================
  3924. * fixed; RegExp validators on node >= v0.6.x
  3925. 2.5.6 / 2012-02-09
  3926. ===================
  3927. * fixed; emit errors returned from db.collection() on the connection (were being swallowed)
  3928. * added; can add multiple validators in your schema at once (#718) [diogogmt]
  3929. * fixed; strict embedded documents (#717)
  3930. * updated; docs [niemyjski]
  3931. * added; pass number of affected docs back in model.update/save
  3932. 2.5.5 / 2012-02-03
  3933. ===================
  3934. * fixed; RangeError: maximum call stack exceed error when removing docs with Number _id (#714)
  3935. 2.5.4 / 2012-02-03
  3936. ===================
  3937. * fixed; RangeError: maximum call stack exceed error (#714)
  3938. 2.5.3 / 2012-02-02
  3939. ===================
  3940. * added; doc#isSelected(path)
  3941. * added; query#equals()
  3942. * added; beta sharding support
  3943. * added; more descript error msgs (#700) [obeleh]
  3944. * added; document.modifiedPaths (#709) [ljharb]
  3945. * fixed; only functions can be added as getters/setters (#707,704) [ljharb]
  3946. 2.5.2 / 2012-01-30
  3947. ===================
  3948. * fixed; rollback -native driver to 0.9.7-3-5 (was causing timeouts and other replica set weirdness)
  3949. * deprecated; MongooseNumber (will be moved to a separate repo for 3.x)
  3950. * added; init event is emitted on schemas
  3951. 2.5.1 / 2012-01-27
  3952. ===================
  3953. * fixed; honor strict schemas in Model.update (#699)
  3954. 2.5.0 / 2012-01-26
  3955. ===================
  3956. * added; doc.toJSON calls toJSON on embedded docs when exists [jerem]
  3957. * added; populate support for refs of type Buffer (#686) [jerem]
  3958. * added; $all support for ObjectIds and Dates (#690)
  3959. * fixed; virtual setter calling on instantiation when strict: true (#682) [hunterloftis]
  3960. * fixed; doc construction triggering getters (#685)
  3961. * fixed; MongooseBuffer check in deepEquals (#688)
  3962. * fixed; range error when using Number _ids with `instance.save()` (#691)
  3963. * fixed; isNew on embedded docs edge case (#680)
  3964. * updated; driver to 0.9.8-3
  3965. * updated; expose `model()` method within static methods
  3966. 2.4.10 / 2012-01-10
  3967. ===================
  3968. * added; optional getter application in .toObject()/.toJSON() (#412)
  3969. * fixed; nested $operators in $all queries (#670)
  3970. * added; $nor support (#674)
  3971. * fixed; bug when adding nested schema (#662) [paulwe]
  3972. 2.4.9 / 2012-01-04
  3973. ===================
  3974. * updated; driver to 0.9.7-3-5 to fix Linux performance degradation on some boxes
  3975. 2.4.8 / 2011-12-22
  3976. ===================
  3977. * updated; bump -native to 0.9.7.2-5
  3978. * fixed; compatibility with date.js (#646) [chrisleishman]
  3979. * changed; undocumented schema "lax" option to "strict"
  3980. * fixed; default value population for strict schemas
  3981. * updated; the nextTick helper for small performance gain. 1bee2a2
  3982. 2.4.7 / 2011-12-16
  3983. ===================
  3984. * fixed; bug in 2.4.6 with path setting
  3985. * updated; bump -native to 0.9.7.2-1
  3986. * added; strict schema option [nw]
  3987. 2.4.6 / 2011-12-16
  3988. ===================
  3989. * fixed; conflicting mods on update bug [sirlantis]
  3990. * improved; doc.id getter performance
  3991. 2.4.5 / 2011-12-14
  3992. ===================
  3993. * fixed; bad MongooseArray behavior in 2.4.2 - 2.4.4
  3994. 2.4.4 / 2011-12-14
  3995. ===================
  3996. * fixed; MongooseArray#doAtomics throwing after sliced
  3997. 2.4.3 / 2011-12-14
  3998. ===================
  3999. * updated; system.profile schema for MongoDB 2x
  4000. 2.4.2 / 2011-12-12
  4001. ===================
  4002. * fixed; partially populating multiple children of subdocs (#639) [kenpratt]
  4003. * fixed; allow Update of numbers to null (#640) [jerem]
  4004. 2.4.1 / 2011-12-02
  4005. ===================
  4006. * added; options support for populate() queries
  4007. * updated; -native driver to 0.9.7-1.4
  4008. 2.4.0 / 2011-11-29
  4009. ===================
  4010. * added; QueryStreams (#614)
  4011. * added; debug print mode for development
  4012. * added; $within support to Array queries (#586) [ggoodale]
  4013. * added; $centerSphere query support
  4014. * fixed; $within support
  4015. * added; $unset is now used when setting a path to undefined (#519)
  4016. * added; query#batchSize support
  4017. * updated; docs
  4018. * updated; -native driver to 0.9.7-1.3 (provides Windows support)
  4019. 2.3.13 / 2011-11-15
  4020. ===================
  4021. * fixed; required validation for Refs (#612) [ded]
  4022. * added; $nearSphere support for Arrays (#610)
  4023. 2.3.12 / 2011-11-09
  4024. ===================
  4025. * fixed; regression, objects passed to Model.update should not be changed (#605)
  4026. * fixed; regression, empty Model.update should not be executed
  4027. 2.3.11 / 2011-11-08
  4028. ===================
  4029. * fixed; using $elemMatch on arrays of Mixed types (#591)
  4030. * fixed; allow using $regex when querying Arrays (#599)
  4031. * fixed; calling Model.update with no atomic keys (#602)
  4032. 2.3.10 / 2011-11-05
  4033. ===================
  4034. * fixed; model.update casting for nested paths works (#542)
  4035. 2.3.9 / 2011-11-04
  4036. ==================
  4037. * fixed; deepEquals check for MongooseArray returned false
  4038. * fixed; reset modified flags of embedded docs after save [gitfy]
  4039. * fixed; setting embedded doc with identical values no longer marks modified [gitfy]
  4040. * updated; -native driver to 0.9.6.23 [mlazarov]
  4041. * fixed; Model.update casting (#542, #545, #479)
  4042. * fixed; populated refs no longer fail required validators (#577)
  4043. * fixed; populating refs of objects with custom ids works
  4044. * fixed; $pop & $unset work with Model.update (#574)
  4045. * added; more helpful debugging message for Schema#add (#578)
  4046. * fixed; accessing .id when no _id exists now returns null (#590)
  4047. 2.3.8 / 2011-10-26
  4048. ==================
  4049. * added; callback to query#findOne is now optional (#581)
  4050. 2.3.7 / 2011-10-24
  4051. ==================
  4052. * fixed; wrapped save/remove callbacks in nextTick to mitigate -native swallowing thrown errors
  4053. 2.3.6 / 2011-10-21
  4054. ==================
  4055. * fixed; exclusion of embedded doc _id from query results (#541)
  4056. 2.3.5 / 2011-10-19
  4057. ==================
  4058. * fixed; calling queries without passing a callback works (#569)
  4059. * fixed; populate() works with String and Number _ids too (#568)
  4060. 2.3.4 / 2011-10-18
  4061. ==================
  4062. * added; Model.create now accepts an array as a first arg
  4063. * fixed; calling toObject on a DocumentArray with nulls no longer throws
  4064. * fixed; calling inspect on a DocumentArray with nulls no longer throws
  4065. * added; MongooseArray#unshift support
  4066. * fixed; save hooks now fire on embedded documents [gitfy] (#456)
  4067. * updated; -native driver to 0.9.6-22
  4068. * fixed; correctly pass $addToSet op instead of $push
  4069. * fixed; $addToSet properly detects dates
  4070. * fixed; $addToSet with multiple items works
  4071. * updated; better node 0.6 Buffer support
  4072. 2.3.3 / 2011-10-12
  4073. ==================
  4074. * fixed; population conditions in multi-query settings [vedmalex] (#563)
  4075. * fixed; now compatible with Node v0.5.x
  4076. 2.3.2 / 2011-10-11
  4077. ==================
  4078. * fixed; population of null subdoc properties no longer hangs (#561)
  4079. 2.3.1 / 2011-10-10
  4080. ==================
  4081. * added; support for Query filters to populate() [eneko]
  4082. * fixed; querying with number no longer crashes mongodb (#555) [jlbyrey]
  4083. * updated; version of -native driver to 0.9.6-21
  4084. * fixed; prevent query callbacks that throw errors from corrupting -native connection state
  4085. 2.3.0 / 2011-10-04
  4086. ==================
  4087. * fixed; nulls as default values for Boolean now works as expected
  4088. * updated; version of -native driver to 0.9.6-20
  4089. 2.2.4 / 2011-10-03
  4090. ==================
  4091. * fixed; populate() works when returned array contains undefined/nulls
  4092. 2.2.3 / 2011-09-29
  4093. ==================
  4094. * updated; version of -native driver to 0.9.6-19
  4095. 2.2.2 / 2011-09-28
  4096. ==================
  4097. * added; $regex support to String [davidandrewcope]
  4098. * added; support for other contexts like repl etc (#535)
  4099. * fixed; clear modified state properly after saving
  4100. * added; $addToSet support to Array
  4101. 2.2.1 / 2011-09-22
  4102. ==================
  4103. * more descript error when casting undefined to string
  4104. * updated; version of -native driver to 0.9.6-18
  4105. 2.2.0 / 2011-09-22
  4106. ==================
  4107. * fixed; maxListeners warning on schemas with many arrays (#530)
  4108. * changed; return / apply defaults based on fields selected in query (#423)
  4109. * fixed; correctly detect Mixed types within schema arrays (#532)
  4110. 2.1.4 / 2011-09-20
  4111. ==================
  4112. * fixed; new private methods that stomped on users code
  4113. * changed; finished removing old "compat" support which did nothing
  4114. 2.1.3 / 2011-09-16
  4115. ==================
  4116. * updated; version of -native driver to 0.9.6-15
  4117. * added; emit `error` on connection when open fails [edwardhotchkiss]
  4118. * added; index support to Buffers (thanks justmoon for helping track this down)
  4119. * fixed; passing collection name via schema in conn.model() now works (thanks vedmalex for reporting)
  4120. 2.1.2 / 2011-09-07
  4121. ==================
  4122. * fixed; Query#find with no args no longer throws
  4123. 2.1.1 / 2011-09-07
  4124. ==================
  4125. * added; support Model.count(fn)
  4126. * fixed; compatibility with node >=0.4.0 < 0.4.3
  4127. * added; pass model.options.safe through with .save() so w:2, wtimeout:5000 options work [andrewjstone]
  4128. * added; support for $type queries
  4129. * added; support for Query#or
  4130. * added; more tests
  4131. * optimized populate queries
  4132. 2.1.0 / 2011-09-01
  4133. ==================
  4134. * changed; document#validate is a public method
  4135. * fixed; setting number to same value no longer marks modified (#476) [gitfy]
  4136. * fixed; Buffers shouldn't have default vals
  4137. * added; allow specifying collection name in schema (#470) [ixti]
  4138. * fixed; reset modified paths and atomics after saved (#459)
  4139. * fixed; set isNew on embedded docs to false after save
  4140. * fixed; use self to ensure proper scope of options in doOpenSet (#483) [andrewjstone]
  4141. 2.0.4 / 2011-08-29
  4142. ==================
  4143. * Fixed; Only send the depopulated ObjectId instead of the entire doc on save (DBRefs)
  4144. * Fixed; Properly cast nested array values in Model.update (the data was stored in Mongo incorrectly but recast on document fetch was "fixing" it)
  4145. 2.0.3 / 2011-08-28
  4146. ==================
  4147. * Fixed; manipulating a populated array no longer causes infinite loop in BSON serializer during save (#477)
  4148. * Fixed; populating an empty array no longer hangs foreeeeeeeever (#481)
  4149. 2.0.2 / 2011-08-25
  4150. ==================
  4151. * Fixed; Maintain query option key order (fixes 'bad hint' error from compound query hints)
  4152. 2.0.1 / 2011-08-25
  4153. ==================
  4154. * Fixed; do not over-write the doc when no valide props exist in Model.update (#473)
  4155. 2.0.0 / 2011-08-24
  4156. ===================
  4157. * Added; support for Buffers [justmoon]
  4158. * Changed; improved error handling [maelstrom]
  4159. * Removed: unused utils.erase
  4160. * Fixed; support for passing other context object into Schemas (#234) [Sija]
  4161. * Fixed; getters are no longer circular refs to themselves (#366)
  4162. * Removed; unused compat.js
  4163. * Fixed; getter/setter scopes are set properly
  4164. * Changed; made several private properties more obvious by prefixing _
  4165. * Added; DBRef support [guille]
  4166. * Changed; removed support for multiple collection names per model
  4167. * Fixed; no longer applying setters when document returned from db
  4168. * Changed; default auto_reconnect to true
  4169. * Changed; Query#bind no longer clones the query
  4170. * Fixed; Model.update now accepts $pull, $inc and friends (#404)
  4171. * Added; virtual type option support [nw]
  4172. 1.8.4 / 2011-08-21
  4173. ===================
  4174. * Fixed; validation bug when instantiated with non-schema properties (#464) [jmreidy]
  4175. 1.8.3 / 2011-08-19
  4176. ===================
  4177. * Fixed; regression in connection#open [jshaw86]
  4178. 1.8.2 / 2011-08-17
  4179. ===================
  4180. * fixed; reset connection.readyState after failure [tomseago]
  4181. * fixed; can now query positionally for non-embedded docs (arrays of numbers/strings etc)
  4182. * fixed; embedded document query casting
  4183. * added; support for passing options to node-mongo-native db, server, and replsetserver [tomseago]
  4184. 1.8.1 / 2011-08-10
  4185. ===================
  4186. * fixed; ObjectIds were always marked modified
  4187. * fixed; can now query using document instances
  4188. * fixed; can now query/update using documents with subdocs
  4189. 1.8.0 / 2011-08-04
  4190. ===================
  4191. * fixed; can now use $all with String and Number
  4192. * fixed; can query subdoc array with $ne: null
  4193. * fixed; instance.subdocs#id now works with custom _ids
  4194. * fixed; do not apply setters when doc returned from db (change in bad behavior)
  4195. 1.7.4 / 2011-07-25
  4196. ===================
  4197. * fixed; sparse now a valid seperate schema option
  4198. * fixed; now catching cast errors in queries
  4199. * fixed; calling new Schema with object created in vm.runInNewContext now works (#384) [Sija]
  4200. * fixed; String enum was disallowing null
  4201. * fixed; Find by nested document _id now works (#389)
  4202. 1.7.3 / 2011-07-16
  4203. ===================
  4204. * fixed; MongooseArray#indexOf now works with ObjectIds
  4205. * fixed; validation scope now set properly (#418)
  4206. * fixed; added missing colors dependency (#398)
  4207. 1.7.2 / 2011-07-13
  4208. ===================
  4209. * changed; node-mongodb-native driver to v0.9.6.7
  4210. 1.7.1 / 2011-07-12
  4211. ===================
  4212. * changed; roll back node-mongodb-native driver to v0.9.6.4
  4213. 1.7.0 / 2011-07-12
  4214. ===================
  4215. * fixed; collection name misspelling [mathrawka]
  4216. * fixed; 2nd param is required for ReplSetServers [kevinmarvin]
  4217. * fixed; MongooseArray behaves properly with Object.keys
  4218. * changed; node-mongodb-native driver to v0.9.6.6
  4219. * fixed/changed; Mongodb segfault when passed invalid ObjectId (#407)
  4220. - This means invalid data passed to the ObjectId constructor will now error
  4221. 1.6.0 / 2011-07-07
  4222. ===================
  4223. * changed; .save() errors are now emitted on the instances db instead of the instance 9782463fc
  4224. * fixed; errors occurring when creating indexes now properly emit on db
  4225. * added; $maxDistance support to MongooseArrays
  4226. * fixed; RegExps now work with $all
  4227. * changed; node-mongodb-native driver to v0.9.6.4
  4228. * fixed; model names are now accessible via .modelName
  4229. * added; Query#slaveOk support
  4230. 1.5.0 / 2011-06-27
  4231. ===================
  4232. * changed; saving without a callback no longer ignores the error (@bnoguchi)
  4233. * changed; hook-js version bump to 0.1.9
  4234. * changed; node-mongodb-native version bumped to 0.9.6.1 - When .remove() doesn't
  4235. return an error, null is no longer passed.
  4236. * fixed; two memory leaks (@justmoon)
  4237. * added; sparse index support
  4238. * added; more ObjectId conditionals (gt, lt, gte, lte) (@phillyqueso)
  4239. * added; options are now passed in model#remote (@JerryLuke)
  4240. 1.4.0 / 2011-06-10
  4241. ===================
  4242. * bumped hooks-js dependency (fixes issue passing null as first arg to next())
  4243. * fixed; document#inspect now works properly with nested docs
  4244. * fixed; 'set' now works as a schema attribute (GH-365)
  4245. * fixed; _id is now set properly within pre-init hooks (GH-289)
  4246. * added; Query#distinct / Model#distinct support (GH-155)
  4247. * fixed; embedded docs now can use instance methods (GH-249)
  4248. * fixed; can now overwrite strings conflicting with schema type
  4249. 1.3.7 / 2011-06-03
  4250. ===================
  4251. * added MongooseArray#splice support
  4252. * fixed; 'path' is now a valid Schema pathname
  4253. * improved hooks (utilizing https://github.com/bnoguchi/hooks-js)
  4254. * fixed; MongooseArray#$shift now works (never did)
  4255. * fixed; Document.modified no longer throws
  4256. * fixed; modifying subdoc property sets modified paths for subdoc and parent doc
  4257. * fixed; marking subdoc path as modified properly persists the value to the db
  4258. * fixed; RexExps can again be saved ( #357 )
  4259. 1.3.6 / 2011-05-18
  4260. ===================
  4261. * fixed; corrected casting for queries against array types
  4262. * added; Document#set now accepts Document instances
  4263. 1.3.5 / 2011-05-17
  4264. ===================
  4265. * fixed; $ne queries work properly with single vals
  4266. * added; #inspect() methods to improve console.log output
  4267. 1.3.4 / 2011-05-17
  4268. ===================
  4269. * fixed; find by Date works as expected (#336)
  4270. * added; geospatial 2d index support
  4271. * added; support for $near (#309)
  4272. * updated; node-mongodb-native driver
  4273. * fixed; updating numbers work (#342)
  4274. * added; better error msg when try to remove an embedded doc without an _id (#307)
  4275. * added; support for 'on-the-fly' schemas (#227)
  4276. * changed; virtual id getters can now be skipped
  4277. * fixed; .index() called on subdoc schema now works as expected
  4278. * fixed; db.setProfile() now buffers until the db is open (#340)
  4279. 1.3.3 / 2011-04-27
  4280. ===================
  4281. * fixed; corrected query casting on nested mixed types
  4282. 1.3.2 / 2011-04-27
  4283. ===================
  4284. * fixed; query hints now retain key order
  4285. 1.3.1 / 2011-04-27
  4286. ===================
  4287. * fixed; setting a property on an embedded array no longer overwrites entire array (GH-310)
  4288. * fixed; setting nested properties works when sibling prop is named "type"
  4289. * fixed; isModified is now much finer grained when .set() is used (GH-323)
  4290. * fixed; mongoose.model() and connection.model() now return the Model (GH-308, GH-305)
  4291. * fixed; can now use $gt, $lt, $gte, $lte with String schema types (GH-317)
  4292. * fixed; .lowercase() -> .toLowerCase() in pluralize()
  4293. * fixed; updating an embedded document by index works (GH-334)
  4294. * changed; .save() now passes the instance to the callback (GH-294, GH-264)
  4295. * added; can now query system.profile and system.indexes collections
  4296. * added; db.model('system.profile') is now included as a default Schema
  4297. * added; db.setProfiling(level, ms, callback)
  4298. * added; Query#hint() support
  4299. * added; more tests
  4300. * updated node-mongodb-native to 0.9.3
  4301. 1.3.0 / 2011-04-19
  4302. ===================
  4303. * changed; save() callbacks now fire only once on failed validation
  4304. * changed; Errors returned from save() callbacks now instances of ValidationError
  4305. * fixed; MongooseArray#indexOf now works properly
  4306. 1.2.0 / 2011-04-11
  4307. ===================
  4308. * changed; MongooseNumber now casts empty string to null
  4309. 1.1.25 / 2011-04-08
  4310. ===================
  4311. * fixed; post init now fires at proper time
  4312. 1.1.24 / 2011-04-03
  4313. ===================
  4314. * fixed; pushing an array onto an Array works on existing docs
  4315. 1.1.23 / 2011-04-01
  4316. ===================
  4317. * Added Model#model
  4318. 1.1.22 / 2011-03-31
  4319. ===================
  4320. * Fixed; $in queries on mixed types now work
  4321. 1.1.21 / 2011-03-31
  4322. ===================
  4323. * Fixed; setting object root to null/undefined works
  4324. 1.1.20 / 2011-03-31
  4325. ===================
  4326. * Fixed; setting multiple props on null field works
  4327. 1.1.19 / 2011-03-31
  4328. ===================
  4329. * Fixed; no longer using $set on paths to an unexisting fields
  4330. 1.1.18 / 2011-03-30
  4331. ===================
  4332. * Fixed; non-mixed type object setters work after initd from null
  4333. 1.1.17 / 2011-03-30
  4334. ===================
  4335. * Fixed; nested object property access works when root initd with null value
  4336. 1.1.16 / 2011-03-28
  4337. ===================
  4338. * Fixed; empty arrays are now saved
  4339. 1.1.15 / 2011-03-28
  4340. ===================
  4341. * Fixed; `null` and `undefined` are set atomically.
  4342. 1.1.14 / 2011-03-28
  4343. ===================
  4344. * Changed; more forgiving date casting, accepting '' as null.
  4345. 1.1.13 / 2011-03-26
  4346. ===================
  4347. * Fixed setting values as `undefined`.
  4348. 1.1.12 / 2011-03-26
  4349. ===================
  4350. * Fixed; nested objects now convert to JSON properly
  4351. * Fixed; setting nested objects directly now works
  4352. * Update node-mongodb-native
  4353. 1.1.11 / 2011-03-25
  4354. ===================
  4355. * Fixed for use of `type` as a key.
  4356. 1.1.10 / 2011-03-23
  4357. ===================
  4358. * Changed; Make sure to only ensure indexes while connected
  4359. 1.1.9 / 2011-03-2
  4360. ==================
  4361. * Fixed; Mixed can now default to empty arrays
  4362. * Fixed; keys by the name 'type' are now valid
  4363. * Fixed; null values retrieved from the database are hydrated as null values.
  4364. * Fixed repeated atomic operations when saving a same document twice.
  4365. 1.1.8 / 2011-03-23
  4366. ==================
  4367. * Fixed 'id' overriding. [bnoguchi]
  4368. 1.1.7 / 2011-03-22
  4369. ==================
  4370. * Fixed RegExp query casting when querying against an Array of Strings [bnoguchi]
  4371. * Fixed getters/setters for nested virtualsl. [bnoguchi]
  4372. 1.1.6 / 2011-03-22
  4373. ==================
  4374. * Only doValidate when path exists in Schema [aheckmann]
  4375. * Allow function defaults for Array types [aheckmann]
  4376. * Fix validation hang [aheckmann]
  4377. * Fix setting of isRequired of SchemaType [aheckmann]
  4378. * Fix SchemaType#required(false) filter [aheckmann]
  4379. * More backwards compatibility [aheckmann]
  4380. * More tests [aheckmann]
  4381. 1.1.5 / 2011-03-14
  4382. ==================
  4383. * Added support for `uri, db, fn` and `uri, fn` signatures for replica sets.
  4384. * Improved/extended replica set tests.
  4385. 1.1.4 / 2011-03-09
  4386. ==================
  4387. * Fixed; running an empty Query doesn't throw. [aheckmann]
  4388. * Changed; Promise#addBack returns promise. [aheckmann]
  4389. * Added streaming cursor support. [aheckmann]
  4390. * Changed; Query#update defaults to use$SetOnSave now. [brian]
  4391. * Added more docs.
  4392. 1.1.3 / 2011-03-04
  4393. ==================
  4394. * Added Promise#resolve [aheckmann]
  4395. * Fixed backward compatibility with nulls [aheckmann]
  4396. * Changed; Query#{run,exec} return promises [aheckmann]
  4397. 1.1.2 / 2011-03-03
  4398. ==================
  4399. * Restored Query#exec and added notion of default operation [brian]
  4400. * Fixed ValidatorError messages [brian]
  4401. 1.1.1 / 2011-03-01
  4402. ==================
  4403. * Added SchemaType String `lowercase`, `uppercase`, `trim`.
  4404. * Public exports (`Model`, `Document`) and tests.
  4405. * Added ObjectId casting support for `Document`s.
  4406. 1.1.0 / 2011-02-25
  4407. ==================
  4408. * Added support for replica sets.
  4409. 1.0.16 / 2011-02-18
  4410. ===================
  4411. * Added $nin as another whitelisted $conditional for SchemaArray [brian]
  4412. * Changed #with to #where [brian]
  4413. * Added ability to use $in conditional with Array types [brian]
  4414. 1.0.15 / 2011-02-18
  4415. ===================
  4416. * Added `id` virtual getter for documents to easily access the hexString of
  4417. the `_id`.
  4418. 1.0.14 / 2011-02-17
  4419. ===================
  4420. * Fix for arrays within subdocuments [brian]
  4421. 1.0.13 / 2011-02-16
  4422. ===================
  4423. * Fixed embedded documents saving.
  4424. 1.0.12 / 2011-02-14
  4425. ===================
  4426. * Minor refactorings [brian]
  4427. 1.0.11 / 2011-02-14
  4428. ===================
  4429. * Query refactor and $ne, $slice, $or, $size, $elemMatch, $nin, $exists support [brian]
  4430. * Named scopes sugar [brian]
  4431. 1.0.10 / 2011-02-11
  4432. ===================
  4433. * Updated node-mongodb-native driver [thanks John Allen]
  4434. 1.0.9 / 2011-02-09
  4435. ==================
  4436. * Fixed single member arrays as defaults [brian]
  4437. 1.0.8 / 2011-02-09
  4438. ==================
  4439. * Fixed for collection-level buffering of commands [gitfy]
  4440. * Fixed `Document#toJSON` [dalejefferson]
  4441. * Fixed `Connection` authentication [robrighter]
  4442. * Fixed clash of accessors in getters/setters [eirikurn]
  4443. * Improved `Model#save` promise handling
  4444. 1.0.7 / 2011-02-05
  4445. ==================
  4446. * Fixed memory leak warnings for test suite on 0.3
  4447. * Fixed querying documents that have an array that contain at least one
  4448. specified member. [brian]
  4449. * Fixed default value for Array types (fixes GH-210). [brian]
  4450. * Fixed example code.
  4451. 1.0.6 / 2011-02-03
  4452. ==================
  4453. * Fixed `post` middleware
  4454. * Fixed; it's now possible to instantiate a model even when one of the paths maps
  4455. to an undefined value [brian]
  4456. 1.0.5 / 2011-02-02
  4457. ==================
  4458. * Fixed; combo $push and $pushAll auto-converts into a $pushAll [brian]
  4459. * Fixed; combo $pull and $pullAll auto-converts to a single $pullAll [brian]
  4460. * Fixed; $pullAll now removes said members from array before save (so it acts just
  4461. like pushAll) [brian]
  4462. * Fixed; multiple $pulls and $pushes become a single $pullAll and $pushAll.
  4463. Moreover, $pull now modifies the array before save to reflect the immediate
  4464. change [brian]
  4465. * Added tests for nested shortcut getters [brian]
  4466. * Added tests that show that Schemas with nested Arrays don't apply defaults
  4467. [brian]
  4468. 1.0.4 / 2011-02-02
  4469. ==================
  4470. * Added MongooseNumber#toString
  4471. * Added MongooseNumber unit tests
  4472. 1.0.3 / 2011-02-02
  4473. ==================
  4474. * Make sure safe mode works with Model#save
  4475. * Changed Schema options: safe mode is now the default
  4476. * Updated node-mongodb-native to HEAD
  4477. 1.0.2 / 2011-02-02
  4478. ==================
  4479. * Added a Model.create shortcut for creating documents. [brian]
  4480. * Fixed; we can now instantiate models with hashes that map to at least one
  4481. null value. [brian]
  4482. * Fixed Schema with more than 2 nested levels. [brian]
  4483. 1.0.1 / 2011-02-02
  4484. ==================
  4485. * Improved `MongooseNumber`, works almost like the native except for `typeof`
  4486. not being `'number'`.