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 251KB

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