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

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