These are chat archives for Automattic/mongoose

10th
Apr 2015
Stephan Kristyn
@nottinhill
Apr 10 2015 07:59
@vkarpov15 thanks foryour reply, e.g. this is where my getters do not work, interestingly, setting them works - https://gist.github.com/nottinhill/3cfaafba995c979f59fe
@vkarpov15 In essence I am trying to directly the functionality of mongoose-currency, since it does not work anymore
Stephan Kristyn
@nottinhill
Apr 10 2015 08:16
If maybe you could "grunt test" mongoose-currency against mongoose 4.0.1 and have a look at it, whats breaking it will help me revamp the plugin, here is the fork, enhanced with coffeescript and grunt now - https://github.com/nottinhill/mongoose-currency
.. the error I am getting says "Are you trying to nest schemas?" when running "grunt tests", this happens when instantiating a schema with the custom type for the first time.
Andrew Andrew
@andrewandrew
Apr 10 2015 08:47
@vkarpov15 I'm talking about https://github.com/linnovate/mean , looks like the most popular one.
to reproduce: git clone, change mongoose version to 4.0.1 in package.json, setup any mongo in settings, run, open root / page.
Stephan Kristyn
@nottinhill
Apr 10 2015 09:04
@andrewandrew Yeoman is more popular than this mean.io thing. I highly suggest you try out yeoman with this generator: https://github.com/DaftMonk/generator-angular-fullstack Yeoman works like a charm, read: more flexible than other stacks.
Valeri Karpov
@vkarpov15
Apr 10 2015 19:11
I'm typically not a big fan of generators / yeoman things - they're great for consultants, but if you expect to be maintaining an app for years you'll still be knocking away the scaffolding years later and have a lot of code that works by accident. Sorta why I don't use express's app generator anymore. I haven't played with linnovate's mean code in a while, but I guess this gives me an excuse too - Lior and co are smart guys, curious to see what they came up with in the last year or so
@nottinhill can you do me a favor and open up an issue for this on Github? It's easy for this stuff to get lost in gitter chat
pickels
@pickels
Apr 10 2015 20:59
Guys, today i finally updated to 4.0.1 from 3.x
Fixed some code error (specially with upsert) but now I can't see the normal event behavior from the older version
I'm testing in Dev, stop the mongodb instance, and i'm getting a disconnection and close event
Firing the mongo instance again, and i get connected and reconnected
But from them, no more events are fired, besides reconnect
Despite that, the reconnection is happening
Is that ok?
Valeri Karpov
@vkarpov15
Apr 10 2015 21:18
hmm what other events would you expect besides reconnect?
pickels
@pickels
Apr 10 2015 21:35
with 3.x i got disconnect and connect, also
since the reconnection is working, it's not a big deal right now, but in production is good to know (with timestmo from winston) when the disconnection happened
and in the other hand, i cant understund the fact that the disconnect event is fired just 1 time
Valeri Karpov
@vkarpov15
Apr 10 2015 23:52
Open up a Github issue, it may be related to mongodb/node-mongodb-native#1265 (reconnect used to be emitted only once unfortunately) but in a non-trivial way because it doesn't look like that code is where disconnect is emitted
I suspect this is an issue with the node driver though, mongoose 4 uses node mongodb driver 2, which is a complete rewrite and likely still has a few quirks