PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 20th of September, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:44:28] <jtthedev> Can someone point me in the right direction ? I would like to change the maximum default pool size
[00:44:32] <jtthedev> i think the default is set to 100
[00:45:01] <StephenLynx> pool for what?
[00:45:22] <jtthedev> from a single host
[00:45:36] <jtthedev> I'd like to have a host be able to make more than 100 concurrent connections
[00:46:46] <StephenLynx> http://8ch.net/tech/res/378967.html
[00:46:50] <StephenLynx> damn it
[00:46:55] <StephenLynx> http://docs.mongodb.org/manual/reference/configuration-options/
[00:46:56] <StephenLynx> here
[00:47:08] <jtthedev> thank you
[00:47:11] <jtthedev> greatly appreciated
[00:47:57] <StephenLynx> net.maxIncomingConnections Type: integer Default: 65536
[00:48:10] <StephenLynx> are you sure your server isn`t accepting more than 100?
[00:48:51] <jtthedev> it will accept more than 100 from different host
[00:48:58] <jtthedev> i can have 500 host connect, that's fine
[00:49:07] <jtthedev> i need a single host to be able to connect more than 100 times
[00:49:30] <zamnuts> joannac, thanks for the help, turns out I had old mongodb IP addresses listed in the firewall, never updated them with the new api-agents.mongodb.com A records.
[00:50:17] <StephenLynx> I think your problem is with your application refusing to open more than 100 connections
[00:50:31] <StephenLynx> or you are leaking connections
[00:50:44] <jtthedev> my application is fetching objects from a remote api
[00:50:56] <jtthedev> when it's iterating over the objects to insert into mongo
[00:51:00] <jtthedev> it will not insert more than 100
[00:51:10] <StephenLynx> are you making sure you are reusing connections?
[00:51:45] <jtthedev> What do you mean ?
[00:51:53] <jtthedev> having 1 connection insert more than 1 object ?
[00:51:56] <StephenLynx> yes.
[00:52:13] <StephenLynx> you don`t open a new connection for every single operation, thats a big no-no.
[00:52:33] <StephenLynx> many drivers use their own connection pool, though.
[00:52:36] <zamnuts> jtthedev, your driver should have a "poolSize" option for server, i.e. in the node.js mongodb driver, we have the following available: {options:{server:{poolSize:2}}}
[00:53:13] <zamnuts> jtthedev, but like StephenLynx said, your pool size should not reflect the number of operations.
[00:53:20] <jtthedev> zamnuts, it is a nodejs driver.
[00:53:28] <jtthedev> if you are fluent in node... please review https://gist.github.com/jterrero/f70c68b6754ee55b353b
[00:53:38] <jtthedev> this is my fetch into mongo
[00:53:44] <zamnuts> if you want to bulk insert, consider buffering into an UnorderedBulkOperation http://mongodb.github.io/node-mongodb-native/2.0/api/UnorderedBulkOperation.html
[00:53:49] <jtthedev> i'm new to node/mongo... i'm a rails developer making the transition to mean
[00:53:49] <StephenLynx> yup
[00:53:55] <StephenLynx> you are opening a new connection for every operation.
[00:53:57] <StephenLynx> you don`t need that.
[00:54:12] <StephenLynx> you open it once and reuse as you wish. you can even store pointers to the collections.
[00:54:15] <StephenLynx> let me show how I work
[00:54:45] <jtthedev> thank you, the guidance is greatly appreciated... nodejs/mongo are new waters for me. i've been working with rails and relational backends for years now
[00:54:55] <jtthedev> rewiring my brain to think node/nosql is a bit of a task
[00:54:58] <StephenLynx> https://gitlab.com/mrseth/LynxChan/blob/master/src/be/db.js
[00:55:17] <StephenLynx> see how I open it once and then provide access to the collections?
[00:55:35] <StephenLynx> with the node driver, even if the connection drops, it will keep the references to the collections when it reconnects.
[00:55:55] <StephenLynx> I tried, I rebooted the db with the application running with no issues :v
[00:56:12] <jtthedev> nice
[00:56:52] <StephenLynx> so thats your problem, you are leaking connections.
[00:57:06] <StephenLynx> and the driver probably tracks that
[00:59:10] <jtthedev> something that's going to require a lot more studying than me writing those few lines
[00:59:29] <jtthedev> the link you sent seemed very involved for the operation i wan't
[00:59:39] <jtthedev> i'm just trying to store the remote json objects into mongo via the api call
[01:00:10] <zamnuts> jtthedev, are you using the native mongodb driver in nodejs (i.e. 'mongodb'), or are you using something like mongoose?
[01:00:31] <jtthedev> zamnuts, native driver
[01:00:39] <jtthedev> should i be looking at mongoose ?
[01:00:41] <StephenLynx> no
[01:00:42] <StephenLynx> god no
[01:00:43] <StephenLynx> :v
[01:00:54] <zamnuts> no, native driver is good, jw
[01:00:57] <StephenLynx> and what I provided is just an example of how to handle connections in an effective manner
[01:01:19] <StephenLynx> how you can just open the connection, get the collection reference and keep using this reference.
[01:01:26] <StephenLynx> that is what you should absorb from that.
[01:01:59] <zamnuts> jtthedev, your application should have a main file, usually "index.js" ... this is where you'll perform a MongoClient.connect(...), then store the "db" result of the connect callback in a "global" (*cringe*) variable of some sort
[01:02:20] <StephenLynx> global?
[01:02:28] <StephenLynx> thats bad
[01:02:42] <StephenLynx> having a module that handles it is a much better design.
[01:02:42] <zamnuts> StephenLynx, sorry, i'm not implying global.db or something similar
[01:03:03] <zamnuts> StephenLynx, i agree, a module that handles it will be more singleton-like
[01:03:23] <StephenLynx> not like you have much of an option with the require system.
[01:03:37] <zamnuts> anyways, jtthedev, how you store the ref to db is wide-ranging, but then in any submodules of the application should reference that single db pointer
[01:03:38] <jtthedev> ok.. so, in rails I have written over the past 3 years about 16 - 18 apps that are in production and used every day within my organization. I am making the switch to node and am trying to tackle them one by one. I am doing it in order of easiest to dificult of what the development process was for me.
[01:03:58] <jtthedev> I know some JS for frontend stuff that I have used in rails views
[01:04:03] <StephenLynx> couple of advices:
[01:04:12] <jtthedev> but this is my first dirve into using js for the entire stack
[01:04:15] <StephenLynx> first: how imports are handled.
[01:04:41] <jtthedev> about 3 of my apps revolve around importing data frome external sources
[01:04:53] <StephenLynx> every source file will be a module on its own that will be converted to a module in a singleton architecture.
[01:05:00] <StephenLynx> when you use require, you get the instance of the module.
[01:05:32] <StephenLynx> second: callbacks. they are the most efficient way to handle async, just make sure you don't nest them. call a separate function when you finish with a callback
[01:05:54] <StephenLynx> this second point is the most common trap people new to node fall into.
[01:06:02] <StephenLynx> and its called "callback hell"
[01:06:28] <jtthedev> hahaha, i can see why.. trust me, i've had my few share of issues with callbacks while making this transition
[01:06:40] <StephenLynx> personally, I nest them ONCE often, because I wrap the inner async in comment and then theres no way to confuse stuff, but is not exactly kosher.
[01:06:51] <StephenLynx> but NEVER I nest twice.
[01:07:00] <StephenLynx> and third:
[01:07:13] <StephenLynx> https://github.com/felixge/node-style-guide
[01:08:46] <StephenLynx> personally I also like to avoid using prototypes. but I won't preach that like the one true way.
[01:09:18] <jtthedev> appreciate it
[01:09:25] <StephenLynx> I understand their use in libraries, but I don't think its a good idea to use them on purely application code.
[01:10:00] <StephenLynx> IMO, it makes much harder to understand the system's logic when you use them
[01:10:33] <StephenLynx> specially when people implement inheritance.
[01:10:39] <StephenLynx> then it becomes a black box
[01:10:41] <jtthedev> heh, funny enough. you guys seem to be cooler then the guys in node.js.... they preach to stay away from mongodb, not sure why. I personally am not a fan of mongodb, mostly due to my career as a dba.. the only nosql databases to impress me so far are graphdb's, but I am sure there are applications where mongo makes a lot more sense than a relational db
[01:11:00] <StephenLynx> node`s community is one of the worst I have ever met.
[01:11:03] <StephenLynx> I avoid it like the plague.
[01:11:03] <jtthedev> StephenLynx, do you know where I can start research for node/mongo on iterating over remote api's for my application ?
[01:11:15] <StephenLynx> regular async code.
[01:11:20] <jtthedev> k
[01:11:22] <StephenLynx> nothing special about it.
[01:11:27] <StephenLynx> what I do suggest
[01:11:35] <StephenLynx> is a pattern I call "asynchronous recursion"
[01:12:04] <zamnuts> jtthedev, node.js guys are opinionated about everything, not just mongodb, i always get the worst advice from that channel
[01:12:13] <StephenLynx> plus they are SJW
[01:12:24] <StephenLynx> "OH, YOU ARE NOT A FEMINIST? DING DONG BANNU CHECK YOUR PRIVILEGE"
[01:12:26] <zamnuts> in fact, someone just said "don't use jshint or jslint" ...dafq
[01:12:45] <StephenLynx> and when they say "I don`t want to write code, I just want to let dependencies do all the work"
[01:13:13] <StephenLynx> "my application has only 100 LOC, don't mind the fact it uses over two dozens of dependencies"
[01:13:22] <jtthedev> i'm not easily swayed, i listen and read for as long as i can before forming my own opinion.... eg, they told me to stay away from mongodb and i was doing it all wrong... but here I am still trying to figure out how to go about solving my issue
[01:13:45] <StephenLynx> I think I can provide you another example
[01:14:07] <StephenLynx> because only recently I figured out the proper way to iterate over something in async properly
[01:14:23] <jtthedev> nice
[01:14:27] <jtthedev> would be helpful and appreciated
[01:14:51] <StephenLynx> https://gitlab.com/mrseth/LynxChan/blob/master/src/be/engine/uploadHandler.js#L493
[01:14:51] <StephenLynx> here
[01:14:58] <StephenLynx> the entry point it on that line
[01:15:19] <StephenLynx> then I have to iterate the object in the parameters.files array in async
[01:15:40] <StephenLynx> so when the operation for each file finishes, I have to execute exports.saveUploads again
[01:15:49] <StephenLynx> you could do that on two ways:
[01:16:00] <StephenLynx> one is to directly call saveUploads once the operation is finished
[01:16:05] <zamnuts> StephenLynx, dude, that "two dozens of dependencies" drives me nuts, when you have more deps than lines of actual logic, there's a problem IMO
[01:16:23] <StephenLynx> and the other is to ONLY let saveUploads call saveUploads once each file is finished.
[01:17:02] <StephenLynx> what is the problem with the former: you will have to pass around ALL the parameters saveUploads requires and are used only up to a certain point of the operation that processes each file
[01:17:32] <StephenLynx> when you make a separate callback to the operation that processes each file, you stop passing parameters once they are no longer used in the operation
[01:17:56] <StephenLynx> because the callback will be treated at saveUploads, which already has these parameters.
[01:18:29] <jtthedev> I would rather call after it's finished
[01:18:34] <jtthedev> how long have you been working with node
[01:18:38] <StephenLynx> over a year
[01:18:41] <jtthedev> and did you have perevious programming exp ?
[01:18:47] <jtthedev> *previous
[01:18:47] <StephenLynx> about 8 or 9 years
[01:18:51] <jtthedev> what lang ?
[01:19:04] <StephenLynx> java, unrealscript, C++, obj C
[01:19:20] <StephenLynx> and I used to do that, and heres the problem:
[01:19:26] <StephenLynx> maintenance became harder and harder
[01:19:34] <StephenLynx> because js doesn`t validate parameter types
[01:19:46] <StephenLynx> so it became easier and easier to screw up the order of parameters
[01:20:25] <StephenLynx> when you apply the pattern I described, you separate the structure of the iteration from the structure of the processing of each iterated element.
[01:20:32] <jtthedev> my previous experience is limited to ruby/plsql
[01:20:50] <jtthedev> and not sure if plsql would really count since it's limited to oracle's db
[01:20:53] <StephenLynx> notice how long the process is for these files.
[01:21:11] <jtthedev> indeed
[01:21:15] <StephenLynx> when the process is 20 lines or so
[01:21:18] <StephenLynx> you don`t notice this issue.
[01:21:36] <StephenLynx> once it spawns a dozen functions, it becomes really cumbersome.
[01:21:46] <StephenLynx> so this is the advice I have for asynchronous iteration.
[01:21:58] <StephenLynx> keep the iteration on a separate callback of the processing of each element.
[01:22:13] <StephenLynx> and allow only the iteration function call itself for the next element.
[01:23:06] <StephenLynx> once you iterate over all the elements, have the iteration function call the callback it received.
[01:23:57] <StephenLynx> I got another one that deals with the lack of transactions, too
[01:24:00] <StephenLynx> if you are interested.
[01:24:27] <jtthedev> please
[01:24:39] <jtthedev> interested in all knowledge
[01:24:49] <StephenLynx> https://gitlab.com/mrseth/LynxChan/blob/master/src/be/engine/modOps/transferOps.js
[01:24:58] <StephenLynx> this one is the callback cascade.
[01:25:20] <StephenLynx> I put a comment
[01:25:36] <StephenLynx> line 430
[01:25:53] <StephenLynx> what I do is to each part of the process to initiate a new callback and pass it to the next part.
[01:26:03] <StephenLynx> if a part fails, it returns an error in its callback
[01:26:34] <StephenLynx> then the part sends the received callback to the function that reverts what it did previously and have the reversal function to execute the callback
[01:26:36] <jtthedev> nice
[01:26:51] <jtthedev> clever too...
[01:26:52] <StephenLynx> the part where I pass the original error along is not a core part of this pattern
[01:27:10] <StephenLynx> ah, a small convention:
[01:27:22] <StephenLynx> if your callback returns an error, have it be the first parameter of the callback
[01:28:27] <jtthedev> interesting way to go about it, I can actually see a few ways I can play with that sort of logic
[01:29:08] <StephenLynx> asynchronous code is fukken awesome :v
[01:29:33] <StephenLynx> and very efficient
[01:29:50] <StephenLynx> because you won't keep resources doing nothing
[01:29:56] <jtthedev> ruby i learned self taught. I'm a pretty decent developer, but with nodejs, I am not going to be going the same route. I am preparing as much as possible, before I start classes on Jan 10th, 2016. I was able to get in, (8% acceptance rate) and the test was a decent study, I had to take it twice before I finally passed. and even passing the test doesn't get you in, you still have to go through like 4 interviews.
[01:30:03] <jtthedev> what do you htink of this curriculum ?
[01:30:04] <jtthedev> http://www.fullstackacademy.com/curriculum
[01:30:22] <StephenLynx> courses are bullshit, IMO
[01:30:38] <StephenLynx> huge waste of time and energy
[01:30:57] <StephenLynx> >Big-O Space/Time Analysis too situational
[01:31:13] <StephenLynx> omg
[01:31:13] <jtthedev> some people learn differently, those people have their ish together.. im taking the courses to cut down the time
[01:31:19] <StephenLynx> did they left out complexity?
[01:31:20] <StephenLynx> like
[01:31:29] <StephenLynx> what were they thinking?
[01:31:32] <jtthedev> i could do it on my own again like i did with ruby / rails
[01:31:42] <StephenLynx> if they are not teaching complexity
[01:31:43] <jtthedev> but it would take me 3 times the time to learn
[01:31:45] <StephenLynx> its rubbish
[01:32:00] <StephenLynx> thats the only thing you don`t usually learn around
[01:32:33] <StephenLynx> that last part about tools and best practices is rubbish too
[01:32:44] <StephenLynx> >Express
[01:32:47] <StephenLynx> lelelel
[01:32:52] <jtthedev> think it wont hurt for my scenario.... i'll learn
[01:32:53] <jtthedev> yeah
[01:32:55] <jtthedev> agreed on that
[01:33:01] <jtthedev> given the requirements to get in
[01:33:09] <StephenLynx> the fact they are teaching a web framework is bad enough
[01:33:11] <jtthedev> you already know git, editors and the likes
[01:33:15] <jtthedev> i'm a vim person
[01:33:20] <StephenLynx> and they picked express while at it
[01:33:21] <jtthedev> some swear by sublime,
[01:33:46] <StephenLynx> I use eclipse because of the lint integration of nodeclipse and auto-formatting, but I think its awful.
[01:34:02] <StephenLynx> >AngularJS
[01:34:05] <StephenLynx> sweet jesus
[01:34:26] <StephenLynx> you asked what I think of this course, I say its crap.
[01:34:28] <jtthedev> i use vim at home.... RubyMine at work
[01:34:43] <StephenLynx> they pad it alot to make it look like its worth
[01:34:51] <jtthedev> what are your issues with express/angular
[01:34:52] <StephenLynx> but left out the most important subject you learn in a classroom
[01:35:13] <StephenLynx> any framework that doesn't abstract something meant to be abstract is useless by design
[01:35:22] <StephenLynx> specially at the front-end
[01:35:37] <StephenLynx> and express particularly is a bad piece of software
[01:35:47] <StephenLynx> bad performance, vulnerabilities, bad design
[01:35:53] <preaction> angular abstracts quite a bit away, most people argue it does too much
[01:35:56] <jtthedev> have you ever dablled with the rails framework ??? Ideally I would like to use node with a framework that will give me a similar MVC development pattern
[01:35:59] <StephenLynx> they just picked trendy stuff
[01:36:14] <StephenLynx> thats a very, very bad practice
[01:36:24] <StephenLynx> to throw everything into a big pile of mud
[01:36:30] <StephenLynx> and try to fit every problem into the tool
[01:37:01] <StephenLynx> the key to good mvc is ignoring the fact a GUI exists in your core back-end design.
[01:37:23] <preaction> sure. you need a limited scope. but how limited can be up to debate. the web framework i use, mojolicious, has its own implementation of a lot of stuff. like django does
[01:37:26] <StephenLynx> when you use a tool that tangles all that together, its not modular anymore.
[01:37:28] <preaction> so, ignore the v
[01:37:53] <StephenLynx> and you start to have issues cropping up and down
[01:37:59] <StephenLynx> because everything is tangled by the framework
[01:38:30] <StephenLynx> and by up and down, I mean these issues affect all layers of the software
[01:38:43] <StephenLynx> they start at a layer and move through all of them
[01:39:01] <jtthedev> if i could find a a framework that works the way the rails framework works, but gives me nodejs as the backend.... that's what I would be looking at... node is a lot more flexible then ruby is
[01:39:13] <preaction> ... what?
[01:39:16] <jtthedev> StephenLynx, do you know what's the clsoest framework to rails that uses node as a backend ?
[01:39:16] <StephenLynx> I suggest you don`t use a framework.
[01:39:23] <jtthedev> really ?
[01:39:27] <preaction> how is node more flexible than ruby?
[01:39:27] <StephenLynx> no, I abhor all sorts of web frameworks.
[01:39:43] <StephenLynx> it gives you a less abstracted tool
[01:39:54] <preaction> what?
[01:39:54] <StephenLynx> with http it gives you LITERALLY two things:
[01:40:01] <StephenLynx> the request object and the response object.
[01:40:02] <jtthedev> it cuts down development time significantly
[01:40:02] <StephenLynx> period.
[01:40:15] <preaction> oh, different conversation
[01:40:27] <StephenLynx> from here you write data to the response object and fetch request data from the request object.
[01:40:52] <StephenLynx> and this reduces overhead. this reduced overhead reduces dev time.
[01:41:04] <preaction> and then you build routines to help you write to the response and read from the request, and then you move those routines into a module, and perhaps start building abstraction, and now you've got a web framework!
[01:41:11] <jtthedev> i've written production apps in less then a week sometimes... not sure i would have been able to achieve that without a framework that already has a pattern in place
[01:41:11] <StephenLynx> no
[01:41:20] <jtthedev> it realyl does help significantly for me
[01:41:22] <jtthedev> just imo
[01:41:23] <StephenLynx> you got a common logic to a certain case on your application
[01:41:40] <jtthedev> brb, smoke break
[01:41:45] <StephenLynx> is not a framework to handle every single case that exists.
[01:42:00] <preaction> the web is the web. there's a lot of things that every single website does
[01:42:07] <StephenLynx> yes, http.
[01:42:17] <StephenLynx> websockets
[01:42:20] <StephenLynx> these are called protocols.
[01:42:27] <StephenLynx> and it makes sense to use libraries that handle these protocols.
[01:42:28] <preaction> omg nowai!
[01:43:04] <preaction> so what you're saying is that it's better to cobble together your own set of libraries and just not call it a framework
[01:43:09] <StephenLynx> no.
[01:43:29] <StephenLynx> I am saying that there are cases where its valid to use libraries.
[01:43:36] <preaction> so i write a json library from scratch? a template library? a url routing library?
[01:43:46] <StephenLynx> read my previous statement.
[01:43:56] <StephenLynx> these protocols and standards are a valid scenario to use a library.
[01:44:07] <preaction> right, so i've got these libraries. at what point do i have my own "web framework"?
[01:44:09] <StephenLynx> because the implementation of a standard don`t affect your system`s logic.
[01:44:14] <StephenLynx> you dont.
[01:44:24] <preaction> now we're arguing semantics
[01:44:24] <StephenLynx> a framework is not just a bunch of libraries.
[01:44:33] <StephenLynx> we are not.
[01:44:44] <preaction> frequently that is exactly what it is, though they're generally called "components" when they're part of something bigger
[01:45:07] <StephenLynx> no, a framework streamlines the whole application through a certain process.
[01:45:14] <StephenLynx> it FRAMES your WORK.
[01:45:19] <preaction> how would your collection of libraries not do that?
[01:45:27] <StephenLynx> how WOULD they do that?
[01:45:32] <StephenLynx> let me give you an example
[01:45:37] <StephenLynx> e-mail.
[01:45:47] <preaction> you've got libraries. you've got a process, and you've streamlined it
[01:45:47] <StephenLynx> library X, send this message to this address.
[01:45:52] <StephenLynx> you didnt.
[01:46:05] <StephenLynx> you just abstracted a protocol or standard and let a library handle that.
[01:46:32] <StephenLynx> you just used someone else's code instead of re writing the exact same thing.
[01:46:54] <StephenLynx> and this person`s code didn`t made any decision specific to your system`s use case.
[01:49:08] <jtthedev> back
[01:49:32] <jtthedev> StephenLynx, this is my argument with frameworks
[01:49:54] <jtthedev> if there's something already out there, that's going to cut down my time in putting an application into production
[01:50:12] <jtthedev> and I have to use some "modules" or "libraries" that someone else wrote (in my case gems for rails)
[01:50:21] <jtthedev> then I am absolutely going to prefer to go that route
[01:50:28] <jtthedev> as it makes me more productive
[01:50:31] <StephenLynx> ok, I will be a little flexible here and give my personal view on a valid use case:
[01:50:59] <StephenLynx> if you have already mastered the base tool and can easily figure out what a framework is doing under the hood
[01:51:19] <StephenLynx> then I say its a valid use case for a framework for the productivity gain.
[01:51:42] <jtthedev> I work for a distributor, very fast pased environment... i'm not building top secret ish for nasa or the nsa... I don't need to write every single piece of code in my app if there's something already out there that will do a fucntion for me
[01:51:46] <StephenLynx> because you could easily do those things and if anything goes wrong, you know what went wrong.
[01:51:54] <jtthedev> for me, it's going to be how fast i go from zero to deployment
[01:52:02] <jtthedev> and a framework imo, gets me there a lot faster than not using one
[01:52:12] <jtthedev> so when I look at things like rails, or express
[01:52:16] <jtthedev> they make a lot of sense for me
[01:52:33] <jtthedev> then having to manually take care of a bunch of stuff that I already had a quicker route to get there and do the same exact thing
[01:52:36] <StephenLynx> I can agree on that, but IMO, when you use a framework without a solid experience with the base tool, you will eventually end up with some big issue that you can`t figure out.
[01:52:39] <jtthedev> i appreciate my time.
[01:52:57] <jtthedev> agreed
[01:53:01] <StephenLynx> and from personal experience,
[01:53:13] <jtthedev> anyone that tries to learn rails, before mastering ruby, isn't going to get too far
[01:53:19] <jtthedev> same with node/express
[01:53:31] <jtthedev> someone who doesn't master jd/node... has no business trying to learn express/angular etc
[01:53:36] <jtthedev> *js/node
[01:53:38] <StephenLynx> the time that it takes to get the basic structure of the system working is not considerable.
[01:53:51] <StephenLynx> and after that you are as fast as you were using a framework.
[01:53:55] <jtthedev> i mean, with your argument
[01:53:57] <jtthedev> lets say
[01:54:02] <jtthedev> you already know how you like to work
[01:54:16] <jtthedev> you build some sort of base that has a core set of functions you know you will reuse over and over
[01:54:25] <jtthedev> wouldn't you just save that base and have that as a template
[01:54:30] <jtthedev> same idea as a framework
[01:55:00] <StephenLynx> not really, I don`t usually design system`s that work as every other I designed often.
[01:55:23] <StephenLynx> I take in consideration their specific requirement and their impact in the system`s architecture.
[01:55:40] <StephenLynx> so I don`t end up with systems that are too similar one to the other.
[01:56:10] <jtthedev> I guess, if that works for you it works for you.
[01:56:19] <jtthedev> i'm not sure what your career path looks like
[01:56:27] <jtthedev> or if you freelance, have a 9-5
[01:56:32] <StephenLynx> regular job.
[01:56:42] <StephenLynx> but I am more of a RnD guy
[01:57:06] <jtthedev> but if you ended up in a culture like mine.. and you are 1 of 2 developers, and one developer uses a framework and leverages it, in you're both working on very similar apps for 2 departments.... he might outperform you most of the time
[01:57:08] <StephenLynx> I have recently introduced cutting edge tech in the company with a real-time chat module using websockets
[01:57:26] <StephenLynx> and worked on a C software that reads serial input
[01:57:49] <StephenLynx> currently I am tasked with OCR research but I am not familiar at all with that, so is going slow.
[01:58:18] <StephenLynx> I don`t worry with others are doing too much.
[01:58:37] <StephenLynx> I take my time to see if I can learn anything from them, but usually I take myself as measurement.
[01:58:38] <jtthedev> i work for a distributor, my applications are usually built around getting rid of manual processes (it sucks, a lot of people have lost their jobs as a result of something i've developed)..
[01:58:59] <StephenLynx> and I think a lot about long-term
[01:59:24] <StephenLynx> so I rather have a slow build-up to the project`s productivity and ensure it will be the best possible when it`s complete.
[01:59:48] <StephenLynx> and the documentation and specs will be the closes thing to perfection too.
[01:59:53] <StephenLynx> closest*
[02:00:16] <jtthedev> last application i built..... we have a customer who has 230+ locations in the eastern US... sends all his orders electronically via email attached as an html file.... prior to the app, the orders were printed out an manually entered into our ERP, it would take 3 customer service reps, all day to key in those orders
[02:00:26] <jtthedev> the process was cut down to 5 minutes a day and now the orders are imported
[02:00:31] <StephenLynx> nice
[02:01:06] <jtthedev> could I have built it without rails and just use ruby and a cron job to schedule it?
[02:01:08] <jtthedev> yeah
[02:01:34] <jtthedev> but building it with rails, made the development process structured, simpler and easier to go back to and make adjustments if needed one day
[02:01:37] <StephenLynx> how long was the development cycle for it?
[02:01:58] <jtthedev> 2 weeks dev, 1 week test then deployed into production
[02:02:23] <StephenLynx> yeah, I will be honest: for such a short development cycle, the impact of not using a framework is much larger.
[02:02:24] <jtthedev> could have been quicker. but our ERP is a POS
[02:02:53] <StephenLynx> but IMO, it wouldn't make much of a difference after the two month mark.
[02:03:06] <jtthedev> i just resigned for 3 years, so i'll be here through 2019... one of my goals is to replace the erp with something we build in house
[02:03:18] <jtthedev> before my time is up
[02:03:31] <jtthedev> which is why, im going to go take that course that i showed you the curriculum for
[02:03:51] <jtthedev> it will help me start getting there faster, because I would rather leverage the time and learn node during the next 3 years
[02:04:00] <jtthedev> and I also got them to pay the 18k the class cost
[02:04:18] <StephenLynx> well, at least you are not paying, but I don't think they will help you much.
[02:04:25] <StephenLynx> 80% of all that is not even related to node.
[02:04:55] <StephenLynx> and what it is, they will go on, and on, and on in classes aimed at the lowest common denominator
[02:05:11] <StephenLynx> that you could figure out just using your free time to work hard on challenging projects.
[02:05:41] <jtthedev> i can see that
[02:05:45] <StephenLynx> when I started learning node
[02:06:01] <StephenLynx> I would work full time at my job on the android project I was assigned
[02:06:09] <jtthedev> i'm still challenbging myself, which is why im here now... instead of just waiting to get there on Jan 10th when class starts
[02:06:11] <StephenLynx> and then work more 2 or three after getting home
[02:06:21] <jtthedev> yep
[02:06:23] <jtthedev> that's my life
[02:06:28] <StephenLynx> and then work more 16 to 20 at weekends
[02:07:02] <StephenLynx> js is more about learning what to NOT use
[02:07:06] <jtthedev> do my work at work, get home and sit at my computer (couch and a 65 inch tv about 6 feed away) for another 10 hours or so
[02:07:21] <StephenLynx> always enable strict mode, always use === and !==
[02:07:47] <jtthedev> yeah, there's a bunch of stuff when i started really learning JS that i havnt found a use for nor shor that i ever will
[02:08:07] <StephenLynx> and even worse, they are plain harmful
[02:08:15] <StephenLynx> == and != are ambiguous
[02:08:32] <StephenLynx> evaluate is a can of worms too
[02:09:23] <jtthedev> alright, it's been aweoms chatting with you today, going to get back to my mongo / node issue with the remote api call... i've added this channel to the list, i'll be in here more frequently in the coming months
[02:09:38] <StephenLynx> k
[02:09:41] <StephenLynx> btw
[02:09:45] <StephenLynx> I got a channel for my project over rizon
[02:09:49] <StephenLynx> #lynxchan
[02:24:55] <macwinner> any tips on a clever methodology to generate an array of tags and their associated posts.. i current have an array of posts which have a subdocument of array of tag objects. post = { title: String, tags: [{text: 'tagtext1'}, {text:'tagtext2'}]}
[02:25:22] <macwinner> i want to have a flat object or array where I can lookup a tag name and see all posts associated with it
[02:30:21] <StephenLynx> what I would do
[02:30:28] <StephenLynx> is to have tags to be a single string
[02:31:00] <StephenLynx> instead of an object with multiple characteristics.
[02:31:12] <StephenLynx> tags: ['taga', 'tagb']
[03:07:21] <macwinner> and just iterate over them?
[03:07:34] <macwinner> either way don't i have to iterate?
[03:10:08] <cheeser> i don't see any reason the tags should be documents and not just strings, no.
[03:12:22] <macwinner> k, i'll just make them strings
[14:37:20] <m3t4lukas> why is there no collection.findOne() in the java driver although documented?
[14:40:03] <m3t4lukas> there's only findOneAnd... methods
[15:05:07] <whaley> m3t4lukas: eh? what are you looking at? DBCollection certainly has those defined: https://github.com/mongodb/mongo-java-driver/blob/master/driver/src/main/com/mongodb/DBCollection.java#L648-L765
[15:16:32] <m3t4lukas> I use MongoCollection or should I be using DBCollection?
[15:17:20] <m3t4lukas> if MongoCollection is deprecated it would be nice if it was marked as deprecated
[17:25:49] <THK> greetings and good morning.
[17:25:53] <THK> question:
[17:26:11] <THK> i have a mongodb master, slave.
[17:26:16] <THK> configured as replicaset
[17:26:23] <THK> they are inside of an amazon VPC.
[17:26:29] <THK> they both have public ips
[17:26:52] <THK> i would prefer they replicate over internal communications.
[17:27:04] <THK> but still work properly for people trying to communicate to bothe..
[17:27:07] <THK> suggestions?
[17:27:22] <THK> more importantly, anyone have a link i could go look at/
[17:30:29] <Derick> THK: have you read all of http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/? (not an expert here)
[17:30:55] <THK> i have not, that is for sure a place to start.
[17:30:58] <THK> ill start there.
[17:31:10] <THK> if anyone has another reference please send it my way
[17:31:28] <THK> :) thanx Derick
[17:32:45] <Derick> THK: apparently, you don't need to do anything as AWS is clever enough to internal resolve their DNS names to the "private IP"
[17:33:05] <Derick> you should use the public DNS name of your instances in your replicaset config and *never* the IP
[17:33:35] <THK> so you set the public ip for both, and aws will just handle the communication internally?
[17:33:38] <Derick> but, VPC
[17:33:42] <Derick> read the link I sent you
[17:33:46] <Derick> it should explain it all :-)
[17:33:49] <THK> ok
[17:33:55] <THK> im reading it now.
[17:34:01] <Derick> http://stackoverflow.com/questions/17601292/how-do-i-configure-mongodb-replicaset-using-elastic-ips-in-ec2 has hints (in the non accepted comments) too
[17:37:19] <THK> Derick:that looks like it is for ec2-classic.. as it mentions that SecurityGroups are ingress only.
[17:37:43] <THK> in vpc Environments you can control ingress and egress in securityGroups
[17:37:48] <Derick> ok, those words mean nothing to me :)
[17:37:54] <THK> HAHAHA ok
[17:37:58] <THK> :) thanx for the link
[17:38:09] <THK> i believe this is a place i can start from.
[17:38:14] <THK> ill see what i can do from here
[17:57:17] <BadApe> i know this probably isn't possible but is it possible to generate a json schema based on a document? yes i can do it in code, but can mongo do it for me?
[17:58:56] <Derick> MongoDB itself can not, but we are working on a tool to help with this
[17:59:28] <THK> oo, is there a mailing list i can get on for that information?
[18:01:37] <Derick> hmm, I presume it's the standard announcement list.
[18:01:47] <Derick> trying to find an online thing, but nothing "official" yet
[18:02:04] <THK> ok.
[18:02:09] <StephenLynx> yeah, I heard there will also have some sort of opt-in schema validation.
[18:02:20] <THK> do you have a general mongodb mailing list i can subscribe to?
[18:02:30] <THK> id love to get these
[18:02:35] <Derick> https://www.mongodb.com/press/new-features-at-global-user-conference
[18:02:42] <Derick> is the official statement I believe
[18:02:58] <Derick> THK: google groups "mongodb-announce" and "mongodb-user"
[18:03:02] <Derick> os is it users...
[18:03:22] <Derick> or*
[18:13:55] <cheeser> we don't really have any json schema plans that I know of
[18:46:43] <BadApe> so mongo doesn't help with schema, so i am going to need someway to validate my json
[18:47:08] <minerale> Schema validation is coming
[18:49:23] <StephenLynx> validate input
[18:49:27] <StephenLynx> and document the schem
[18:49:29] <StephenLynx> thats what Ido.
[18:49:46] <StephenLynx> schema validation imposes a heavy overhead.
[22:53:53] <StephenLynx> hey, is it possible to keep the cursor open and receive new documents without having to open a new tailable cursor?
[23:03:55] <StephenLynx> the damn tailable cursor keeps closing
[23:04:01] <StephenLynx> I insert documents and I don`t receive them
[23:04:28] <StephenLynx> is there any trick to it or the driver is bugged? I am on node.js native driver
[23:08:06] <StephenLynx> http://pastebin.com/CxuBi9G0 I know I am using the right collection because I get the documents at first
[23:08:14] <StephenLynx> but when I insert more, I don't receive them
[23:15:59] <cheeser> there's an await flag...
[23:17:54] <StephenLynx> I think I got what the issue was:
[23:18:01] <StephenLynx> the original example had the flag
[23:18:08] <StephenLynx> but the flag changed, so it didn`t work
[23:18:34] <StephenLynx> so I cut it completely trying to reduce stuff that could be going wrong and cut the flag and didn't try to put it
[23:18:41] <StephenLynx> yeah, it works now