These are chat archives for Automattic/mongoose

9th
Jul 2018
mongoosebot
@mongoosebot
Jul 09 2018 00:00
:tada: We just released version 5.2.2 :tada:

5.2.2 / 2018-07-08

  • fix(model+query): add missing estimatedDocumentCount() function #6697
  • docs(faq): improve array-defaults section #6695 lineus
  • docs(model): fix countDocuments() docs, bad copy/paste from count() docs #6694 #6643
  • fix(connection): add startSession() helper to connection and mongoose global #6689
  • fix: upgrade mongodb driver -> 3.1.1 for countDocuments() fix #6688 #6666
  • docs(compatibility): add MongoDB 4 range #6685
  • fix(populate): add ability to define refPath as a function #6683 lineus
  • docs: add rudimentary transactions guide #6672
  • fix(update): make setDefaultsOnInsert handle nested subdoc updates with deeply nested defaults #6665
  • docs: use latest acquit-ignore to handle examples that start with acquit:ignore:start #6657
  • fix(validation): format properties.message as well as message #6621
Gerald
@campanagerald
Jul 09 2018 06:25
guys. we have existing mongodb database (docker image). we want to migrate to mongodb 4.0. I'm trying to find a docker image where replica set is enabled and I can't find any.
Mihajlo Ilijić
@Pritilender
Jul 09 2018 06:27
I don't use dockerized Mongo, but I've found this
Also, it seams like there's no official image ATM for Mongo 4
Kev
@lineus
Jul 09 2018 11:42
@ianpaschal you have a typo in CrankRight.js techincal vs technical
Ian Paschal
@ianpaschal
Jul 09 2018 11:44
hmm let me check that it isn’t a typo i made in my gist (i stripped stuff down a bit for the example)
but thanks in advance for taking a look haha
does it look right otherwise?
Kev
@lineus
Jul 09 2018 11:47
line 50 needed to be changed also, but other than those 2 things it worked for me.
should just be part = new Part( request.body );
I figured that was an artifact from creating the example
Ian Paschal
@ianpaschal
Jul 09 2018 11:48
ah yes that’s because i have lots and lots of models and was importing them all as models and then creating a new models[request.body.kind]({request.body})
Ian Paschal
@ianpaschal
Jul 09 2018 15:47
@lineus Ugh... it was indeed the typo. FML. Thank you for your help.
Nikita Andryushchenko
@mikitachu
Jul 09 2018 15:57
Hello. Is there way to omit _id if it is provided on create or save? So if Model.create({ _id: 'someid' }), provided _id is ignored and _id is auto generated?
Martin Puza
@zaubara
Jul 09 2018 17:09
Hey! Is find({...}).populate('something').stream() supposed to work in the most recent mongoose?
I seem to only get the IDs
Nevermind; guess stream is deprecated and replaced by cursor()
Kev
@lineus
Jul 09 2018 21:09
@ianpaschal anytime :)
Kev
@lineus
Jul 09 2018 21:20
@mikitachu you can use a setter on the _id path to ignore the _id property on the input object and just return a new ObjectId example gist