These are chat archives for Automattic/mongoose

3rd
Apr 2015
Alex Hatzipanis
@hatzipanis
Apr 03 2015 02:47
Is the correct way to add a text index to multiple models: Model.schema.index() ?
Tyler Mace
@tylerdmace
Apr 03 2015 05:44
@LiamKarlMitchell @vkarpov15 Thank you, both. My Mongoose connection manager does indeed create new connections with createConnection(). One connection object (with a pool of 5 connections) per user is maintained. Everything seems to be working OK (mostly). I think I'm running into some issues where the connections to a database will sometimes drop and I am not sure how best to handle that. Other than that, though, things seem to be working.
Tyler Mace
@tylerdmace
Apr 03 2015 05:52
@LiamKarlMitchell I'm not sure I see the advantage of using a child process to handle these requests. Can you explain your reasoning a bit more there. If that's the route I need to go, I'd rather find out now -- rather than later because of major issues arising. As it stands, using child process to handle the requests would have the added work of managing subprocesses in addition to multiple DB connections and that overhead just doesn't seem to have any immediate perks. Also, the aim the application is to have a single UI (application) installation that every user of the system would use; ie, everyone goes to myapp.com to interact with it -- but upon login, they would have a way to set a custom DB for their own data (data that doesn't drive the UI itself but functions of the application). Hope that makes sense.
Liam Mitchell
@LiamKarlMitchell
Apr 03 2015 07:20
@tylerdmace Sure it would add some overhead but probably not to much more than managing connections per user already does, My thinking was it would allow connections + data to be separated to prevent the possibility of leaking information between them, or if a process was to die / or block for some reason it would not effect the other users of the system. And maybe that you would be able to handle more requests, only after the inital authentication would you pass the socket to the child process for the users group (If you were to have multiple users in same group it could be useful) But it all depends on what your doing :) Maybe its not a good idea for your use case i dunno :D. I am implementing child processes for one of my projects and it seems it would of been easier to do early on. Good luck with the project though let us know how it works out? :)
Joseph Thibeault
@jrthib
Apr 03 2015 16:37
For some reason when one of my field validators throws a validation error, it crashes my node app. Any ideas?
i’m creating the document using Model.create and I’m catching the errors thrown by that
Joseph Thibeault
@jrthib
Apr 03 2015 19:37
nevermind, had to update a library
version problems