PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 24th of August, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:50] <joannac> That doesn't make sense. Primary preferred means it will read from the primary if possible
[00:02:06] <joannac> so you'll be reading from the primary anyways?
[00:04:39] <joannac> I guess if you lose primary, you will still get reads, though maybe from out-of-date data
[00:04:48] <joannac> so if that's suitable, then sure
[01:50:35] <ehershey> /last -pub
[01:50:38] <ehershey> oops!
[03:44:18] <shkx> Hey guys, ive run int oan issue where I need to import a bunch of data from one cluster (lets say in our prod environment) to another (lets say dev).. There maybe some duplicate data like primary keys and etc. I had alook at the syntax for mongorestore and it states that if there is a duplicate record, it will skip that and continue, and will only perform an INSERT operation, not UPDATE. I also noticed you can use the
[03:44:35] <shkx> sorry, --drop, not --flag
[03:44:48] <shkx> my question is if you are using just mongorestore so that it will skip the duplicate info, does it inform you which data was skipped?
[03:45:28] <shkx> im writing a python script atm to parse the BSON data and check for any duplicate data but its probably just going to take a while to do that and id prefer it greatly if there is a way within Mongo to check for duplicate data
[04:05:52] <joannac> shkx: I don't think so, unless you check the logs
[04:31:40] <movedx> Hey guys. How can I go about filling a MongoDB installation with some example data? I need to do this from the CLI, without having to go into a shell. I'm doing this from Ansible.
[04:31:54] <movedx> I can write and push a shell script, etc.
[04:32:20] <shkx> joannac: no problem
[04:33:58] <joannac> movedx: erm, I don't understand the question. write a js script that loads data and use --eval?
[04:34:32] <movedx> joannac: Sure, I guess that works. I could write something in Python too... OK, I'll do that. Sorry for wasting your time - I should have given it more thought.
[04:36:50] <joannac> movedx: no problems
[05:35:08] <shkx> joannac: is it possible when using mongorestore to specify a new collection name
[05:35:20] <shkx> or would i just rename the files
[05:35:30] <shkx> before restore
[05:41:00] <joannac> shkx: http://docs.mongodb.org/v2.6/reference/program/mongorestore/#cmdoption--collection
[05:43:26] <shkx> thanks
[05:45:29] <shkx> joannac: specifying the full path when doing mongorestore doesnt seem to work
[05:50:33] <joannac> shkx: pastebin an example?
[05:51:23] <shkx> okay
[05:51:59] <shkx> joannac: one sec
[05:55:07] <shkx> joannac: http://pastie.org/10371721
[05:55:47] <joannac> shkx: erm
[05:56:40] <shkx> sorry i tried a few things as you can see :) i am not a mongo expert
[05:56:55] <joannac> 1. you should be obfuscating passwords. 2. --collection takes a collection name 3. the path should be the last argument
[05:57:47] <joannac> the last one you have is the closest. Instead of "--collection..." have "-c AutoPaymentInfo-bulk /mongo-backups/new/......"
[05:57:50] <shkx> obfuscated passwords
[05:57:55] <shkx> i figured it out thank you joannac
[05:58:00] <shkx> i will look into this obfuscation
[06:05:28] <shkx> joannac:
[06:05:30] <shkx> do you have any links
[06:05:36] <shkx> for obfuscated passwords
[06:09:38] <joannac> shkx: all i mean is, when I ask for an example, you should not share the password
[06:09:55] <joannac> i.e. instead of copying and pasting, replace the password with XXXX
[06:10:03] <shkx> oh
[06:10:13] <shkx> that wasnt the real password :) and you have no ip address...
[06:11:05] <joannac> oh. okay then
[06:11:10] <joannac> it looked like a password :)
[06:16:19] <shkx> lol yeah
[06:16:25] <shkx> thanks joannac :) you are really helpful
[06:19:44] <joannac> :) you're welcome shkx
[10:41:20] <yopp> hum
[10:41:29] <yopp> with this balancer thing
[10:42:00] <yopp> after 2.4 -> 3.0 updgrade some mapreduces are failed, because there a migration lock on sharded collection
[14:03:47] <atomicb0mb> hello ! Is there any document where I can read about the difference between upsert, update, and save?
[14:17:09] <sabrehagen> how can i monitor to see if mongodb is paging to disk?
[14:37:02] <danijoo> if I do `db.collection.remove()`, will it block the whole database or allow me to still write new entries while old ones are deleted?
[14:37:38] <danijoo> (I want to remove all entries of a pretty large database in production)
[14:42:03] <saml> danijoo, why not just drop collection?
[14:42:47] <saml> how big is your large database in production? 2GB?
[14:43:03] <danijoo> saml, ~50gb
[14:43:13] <saml> drop will take <1 sec
[14:43:27] <saml> remove is really expensive
[14:43:39] <saml> especially if you ahve lots of indexes
[14:43:40] <danijoo> yeah i think you are right
[14:43:46] <danijoo> i came up with that right after asking
[14:43:55] <danijoo> ill make a script for drop + immediatly recreate
[14:44:52] <saml> i hope your apps are written resilient to temporary inconsistency. or with eventual consistency of mongodb in mind
[14:46:26] <danijoo> yeah thats not a problem
[14:47:00] <danijoo> the db is more like a giant cache to limit queries against a 3rd party api
[14:50:44] <Sna4x8> When querying, why is it that the AND operations can optionally be an object--{name: 'foo', age: 2}--while the OR must be an array--{$or: [{<expression>},..{<expression>}]}? Is it just a short-hand convenience?
[14:51:34] <Sna4x8> That is, why can't one find({$or: {name: 'foo', age: 2}})?
[14:51:49] <fontanon> Hi! Is this the best irc channel to ask about nodejs mongoose questions ?
[14:55:00] <doc_tuna> fontanon: no, for mongoose, go to mongoose
[14:55:15] <fontanon> #mongoose ?
[14:55:20] <doc_tuna> people here use mongodb directly
[14:55:31] <doc_tuna> *cough* which is the way you should use it too *cough*
[14:55:48] <StephenLynx> lol mongoose
[14:56:21] <StephenLynx> yeah, most people here completely abhor mongoose. at least for the ones experienced with mongo.
[14:56:43] <StephenLynx> the only advice you will get is "don't use it"
[14:58:00] <fontanon> I respect your opinions, buts working good for me.
[14:58:24] <doc_tuna> try umm #mongoosejs?
[14:58:38] <fontanon> doc_tuna, empty
[14:58:39] <doc_tuna> not sure where their official chats are at
[14:59:15] <fontanon> doc_tuna, thnks I think it is
[14:59:24] <doc_tuna> gl
[15:02:32] <sabrehagen> for those who have mastered using the mongodb native node.js driver, do you any example code that is essentially the 'to-do' app for the driver, i.e. it does all common CRUD application tasks using the optimal design patterns?
[15:02:36] <saml> Sna4x8, {a:b,c:d} and $and:[{a:b}, {c:d}] might not be exactly the same since $and shortcircuits
[15:03:00] <saml> for {a:b,c:d}, c==d might be checked first
[15:03:05] <saml> maybe not. i'm bullshitting
[15:03:21] <StephenLynx> sabrehagen that is already done by the driver.
[15:04:25] <StephenLynx> the only thing you need is the documentation http://mongodb.github.io/node-mongodb-native/2.0/api/
[15:04:46] <Sna4x8> saml: Thanks, and I agree with that, but with AND you can use either option. With the former the user doesn't care about the order of evaluation.
[15:05:44] <sabrehagen> what's the commonly accepted counterpart to mongoose's populate functionality using the driver?
[15:05:45] <Sna4x8> With OR it seems like one is required to use the array notation but, just like AND, most (all?) of the time the order is irrelevant.
[15:06:10] <StephenLynx> what is the populate?
[15:06:15] <sabrehagen> sorry badly explained
[15:07:29] <Sna4x8> saml: Futhermore, OR is short-circuit evaluated as well, right?
[15:07:32] <sabrehagen> for a set of documents, you frequently want to expand an object id to properties of the referenced document, the notion of 'populating' the parent document with referenced data.
[15:07:47] <StephenLynx> wot
[15:07:58] <sabrehagen> for an array of documents, how do you do this efficiently with the driver?
[15:08:11] <StephenLynx> an array of documents is called a collection
[15:08:22] <StephenLynx> and I don't have to do anything about it
[15:08:36] <saml> Sna4x8, i don't know. maybe $or does things in parallel and accepts first check
[15:12:10] <sabrehagen> i was hoping you might have grown up if somebody asked you a serious question, but it looks like you don't seek to teach, rather you seek ostracise those coming from a simpler system.
[15:12:35] <StephenLynx> what
[15:12:45] <StephenLynx> I gave you a serious answer
[15:12:52] <StephenLynx> I didn't meant to be aggressive at all.
[15:13:06] <sabrehagen> seriously? that's your attempt to help?
[15:13:30] <StephenLynx> what did you expect?
[15:13:39] <sabrehagen> too much of you.
[15:13:44] <StephenLynx> lel
[15:14:01] <Sna4x8> Similar question: Is there ever a time where the order of AND or OR operations matters when querying? (Obviously, disregarding mixing the two operators.)
[15:14:22] <Derick> Sna4x8: i don't think so, unless you nest
[15:14:29] <diegoaguilar> Hello, I connect to a mongolab database from mongoshell giving user and password
[15:14:39] <diegoaguilar> one the same shell I try to "access" to a local database too
[15:14:46] <Sna4x8> Derick: That's what I thought, but I wasn't sure if I was missing a corner case or something.
[15:14:58] <diegoaguilar> with connect function and new Mongo.getDB
[15:15:11] <diegoaguilar> but that won't let me normally use local database (its giving permissions problems)
[15:15:30] <diegoaguilar> how can I access multiple databases
[15:15:33] <diegoaguilar> in same shell?
[15:15:44] <diegoaguilar> with its proper permissions for each?
[15:15:46] <Derick> are they on the same host?
[15:16:03] <diegoaguilar> nope
[15:16:04] <diegoaguilar> distinct
[15:16:13] <Derick> I didn't think the shell supported that.
[15:16:25] <Derick> I could be wrong though.
[15:17:33] <diegoaguilar> hmm
[15:17:46] <saml> new Mongo('localhost').getDB('yolo')
[15:17:59] <Derick> saml: wouldn't that lose the connection to the remote one?
[15:19:08] <diegoaguilar> saml, Derick
[15:19:16] <sabrehagen> can anybody in the channel shed some light on my populate question above? for those who aren't familiar with mongoose's populate: http://mongoosejs.com/docs/populate.html
[15:19:18] <diegoaguilar> I login to remote, it has credentials
[15:19:33] <saml> var l = new Mongo('localhost').getDB('yolo'); db is your remote. l is local
[15:19:44] <diegoaguilar> then I do new Mongo('localhost').getDB('yolo')
[15:19:52] <diegoaguilar> l would be local
[15:20:00] <diegoaguilar> and then I cant do a show collections on local
[15:20:11] <diegoaguilar> at it actually thinks upon the remotes localhost I guess
[15:20:14] <StephenLynx> ah, that? relations?
[15:20:18] <saml> l.getCollectionInfos()
[15:20:23] <saml> l.getCollectionNames()
[15:20:25] <diegoaguilar> btw the remote is Mongolab
[15:20:33] <StephenLynx> you just handle that in your application using fake relations.
[15:20:38] <StephenLynx> sabrehagen
[15:20:59] <StephenLynx> there is not tool for that.
[15:21:22] <StephenLynx> you just put a value that references a different document in a different collection and work knowing that.
[15:21:33] <sabrehagen> so you have any sample apps written in node that demonstrate that? e.g. an archetypal to-do app?
[15:21:48] <StephenLynx> I have multiple systems that does that.
[15:21:56] <StephenLynx> but there isn't a boilerplate to that.
[15:22:08] <StephenLynx> gitlab.com/mrseth/LynxChan
[15:22:41] <StephenLynx> I just have my boards having a field called boardUri and then threads belonging to that board also have a field called boardUri with the value of the board they belong to.
[15:23:08] <saml> sabrehagen, you're looking for a todo app example using node.js and mongodb?
[15:23:14] <saml> there should be plenty
[15:23:31] <StephenLynx> https://gitlab.com/mrseth/LynxChan/blob/master/doc/Model.txt
[15:23:36] <StephenLynx> my database model
[15:23:49] <StephenLynx> all fields marked with * are fake relations.
[15:24:06] <saml> but being node.js, it won't be simple. they will probably involve angular.js, react.js, gulp, grunt, expressjs, and other crap
[15:24:25] <StephenLynx> wrong
[15:24:38] <StephenLynx> I mean
[15:24:51] <StephenLynx> the community is dumb AF and usually use all that crap.
[15:24:55] <StephenLynx> but you don't have to.
[15:25:11] <StephenLynx> the driver documentation provides examples to everything using vanilla.
[15:25:26] <StephenLynx> it just have a bad habit of nesting callbacks, but for examples I think its passable.
[15:32:55] <doc_tuna> i have a node codebase that is express.js with some middleware and a swagger interface
[15:33:05] <doc_tuna> for building apis in
[15:34:21] <sabrehagen> StephenLynx: that codebase is fascinating.
[15:34:28] <StephenLynx> really?
[15:35:07] <sabrehagen> it looks like the code of a javascript veteran
[15:35:14] <StephenLynx> actually
[15:35:25] <StephenLynx> I have started using js for about a year only
[15:35:49] <sabrehagen> what did you write in previously?
[15:35:55] <StephenLynx> java, unrealscript
[15:36:09] <sabrehagen> how long have you coded for?
[15:36:11] <StephenLynx> obj-C
[15:36:14] <StephenLynx> 9 years I guess
[15:36:25] <sabrehagen> interesting.
[15:36:32] <StephenLynx> people are usually polarized about my code.
[15:36:40] <StephenLynx> either they think its great or that its shit :v
[15:36:53] <StephenLynx> I have worked towards improving code legibility this weekend
[15:36:58] <StephenLynx> splitting large files into multiple parts
[15:37:11] <StephenLynx> I had a file with over 2 thousand LOC
[15:37:20] <StephenLynx> I broke it into 6 parts now
[15:37:24] <sabrehagen> what module are you most proud of at the moment?
[15:37:39] <StephenLynx> a module in what sense?
[15:37:45] <sabrehagen> in the whole system. i.e. what has the most elegance as a result of abstraction?
[15:37:54] <StephenLynx> hm
[15:37:58] <StephenLynx> the front-end
[15:38:04] <sabrehagen> really.
[15:38:05] <StephenLynx> the way it handles the front-end project.
[15:38:08] <StephenLynx> you see
[15:38:14] <sabrehagen> that's a surprise. i thought it would have been back end for sure.
[15:38:16] <StephenLynx> this system it has to use HTML templates
[15:38:19] <StephenLynx> oh, its the back-end
[15:38:32] <StephenLynx> take a seat and let me explain how the engine deals with the front-end
[15:38:39] <StephenLynx> if you see on lynxhub.com
[15:38:49] <StephenLynx> you will see this project is an engine that runs a site.
[15:39:06] <StephenLynx> but the site doesn't require javascript, the engine generates the html
[15:39:27] <sabrehagen> right.
[15:39:29] <StephenLynx> so I need to find templates, fill in stuff and save a webpage.
[15:39:41] <StephenLynx> if you take a look into the engine, templates are nowhere to be seen.
[15:39:56] <StephenLynx> but you will notice in the readme, it mentions front-end projects
[15:40:19] <StephenLynx> you specify a path to the front-end, it looks for a json file in the directory
[15:40:27] <StephenLynx> and this json file indicates where is each of the templates.
[15:40:52] <StephenLynx> so you could completely change the layout of the site without even bringing it down.
[15:41:15] <StephenLynx> you just change the path to the front-end and the engine will reload the pages and start using the new front-end files.
[15:41:29] <StephenLynx> there is even a GUI to change settings that include the path to the front-end.
[15:41:54] <sabrehagen> cool. sounds fun. are you purposely running without javascript?
[15:41:58] <StephenLynx> yes.
[15:42:03] <StephenLynx> demographics.
[15:42:14] <sabrehagen> what do you mean?
[15:42:25] <StephenLynx> the people I am trying to appeal to would chew my liver if I were to require javascript for the site to be used.
[15:42:49] <nignog> Halo
[15:42:52] <StephenLynx> wat
[15:42:59] <StephenLynx> that fps?
[15:43:16] <StephenLynx> you can even post without cookies too.
[15:43:30] <StephenLynx> but its easier to post with cookies though
[15:43:34] <sabrehagen> you have to be careful, you're getting a little to modern with your design as it is.
[15:43:38] <nignog> Can I ask something about "populate" from mongoose orm
[15:43:41] <StephenLynx> no
[15:43:53] <StephenLynx> I mean, you can. but no one will answer.
[15:44:00] <StephenLynx> too modern?
[15:44:02] <nignog> Why is that?
[15:44:03] <StephenLynx> what do you mean?
[15:44:11] <StephenLynx> because people here abhor mongoose.
[15:44:17] <StephenLynx> specially me.
[15:44:20] <StephenLynx> but you can try.
[15:44:48] <StephenLynx> and afaik, mongoose is an ODM
[15:45:05] <StephenLynx> since it handles documents and not a relational database.
[15:46:22] <nignog> Well, it's likely about the structure of database itself
[15:47:24] <sabrehagen> how many chans are you part of?
[15:48:14] <StephenLynx> none.
[15:48:32] <StephenLynx> I am just running an instance of the engine so people can see it running.
[15:48:48] <sabrehagen> you're the writer of the software, no?
[15:48:51] <StephenLynx> yes.
[15:49:48] <sabrehagen> so surely your desire to build a chan from scratch came from being an avid user of chans?
[15:50:01] <duck_tape> anybody in here use ycsb to benchmark mongo ?
[15:50:02] <StephenLynx> oh, you mean user?
[15:50:08] <sabrehagen> yes
[15:50:09] <StephenLynx> I thought you mean as in on staff of a chan.
[15:50:14] <StephenLynx> I have used many.
[15:50:24] <sabrehagen> enough to feel as though you know the community?
[15:50:30] <StephenLynx> pretty much.
[15:52:02] <StephenLynx> on lynxhub I put my motivations on the about page
[15:52:18] <StephenLynx> http://static.lynxhub.com/about.html
[15:53:10] <sabrehagen> imagine you wanted to serve an api to be consumed by a web app as an alternative to the html version. do you have an internal api layer you could hook that into?
[15:53:13] <sabrehagen> yes, i read that.
[15:53:18] <StephenLynx> yes
[15:53:37] <StephenLynx> lynxhub.com/lynxchan/res/1.json
[15:53:38] <sabrehagen> i would imagine so
[15:53:51] <StephenLynx> and the controls also can be used by sending json parameters
[15:54:04] <StephenLynx> the only parts I am yet to make usable by json are the dynamic pages
[15:54:06] <sabrehagen> nice.
[15:54:12] <StephenLynx> but that is on the roadmap
[15:54:28] <StephenLynx> is just not a priority
[15:55:04] <StephenLynx> in the docs there is the specification of both the json api controls and the static json data.
[15:56:22] <sabrehagen> i started with the MEAN stack in december 2014 to build a web app. i had never done any web service nor web app development. i could tell having my system be dependent on mongoose was something i didn't want to have, but it was the only immediate way to get going.
[15:56:28] <StephenLynx> ugh
[15:56:37] <StephenLynx> MEAN is pretty much
[15:56:45] <StephenLynx> radioactive aids cancer
[15:56:58] <sabrehagen> i've written an internal api behind which mongoose is abstracted, meaning i could convert the access to the nodejs driver exclusively, or even another database entirely.
[15:57:27] <StephenLynx> yeah, I don't bother with that. my code depends on the native driver and thats it.
[15:57:46] <StephenLynx> I mean
[15:58:06] <StephenLynx> it could be changed on the db.js file so it would interpret the commands to be run somewhere else.
[15:58:28] <StephenLynx> but I don't intend to use anything else than I am using.
[15:59:21] <StephenLynx> some dude bitched at me for not abstracting the database and I had to explain him there is no other database that provides the tool I use from mongo
[15:59:39] <StephenLynx> the tools*
[15:59:57] <StephenLynx> the problem is that he really thought I was obliged to take his input
[16:00:25] <sabrehagen> have you run load tests?
[16:00:44] <StephenLynx> sort of.
[16:01:08] <StephenLynx> I have ran a benchmark where I would load a static html 1000 times with 200 or 50 concurrent requests
[16:01:10] <StephenLynx> 2ms per request
[16:01:13] <diegoaguilar> Hello, how can I tell MongoDB to write databases to a particular mount point?
[16:01:40] <StephenLynx> 50 to 70ms per thread reply without images
[16:02:26] <StephenLynx> it only broke because of an issue with the driver that I had to circumvent.
[16:02:32] <StephenLynx> but fixed that last week
[16:04:30] <sabrehagen> so that's 200 requests concurrently with 70ms response time. that's the kind of beauty you'd hope for from node and mongo together in their rawest form.
[16:04:56] <sabrehagen> i'd like to see how many concurrent users it would support before it exceeded 200ms.
[16:04:59] <StephenLynx> and that is for posting
[16:05:12] <StephenLynx> where it has to perform lots and lots of operations and checks
[16:05:42] <StephenLynx> and on a SSD
[16:05:44] <StephenLynx> no
[16:05:46] <StephenLynx> hdd*
[16:05:58] <StephenLynx> on a VM
[16:06:33] <Sna4x8> Shoot, with that number of requests (only 200 concurrent) we get comparable (70ms) performance using SQL. With a high level of abstraction, I might add.
[16:07:30] <StephenLynx> yeah, but I don't know what kind of operation you are performing.
[16:07:46] <StephenLynx> on readings I can serve a page in 2ms
[16:09:27] <sabrehagen> StephenLynx: do you consider a database call almost inconsequential? that is, it's just like a direct access memory operation on a json object?
[16:09:42] <StephenLynx> that depends on the operation.
[16:09:59] <StephenLynx> if its a small collection that is accessed frequently
[16:10:05] <StephenLynx> then the overhead is negligible
[16:10:35] <sabrehagen> what's an example of a collection size at each end of the spectrum and the type of query you might run on it?
[16:10:53] <StephenLynx> no idea.
[16:11:20] <StephenLynx> I don't have much experience running large and active databases.
[16:11:32] <StephenLynx> I just know from others that skips are slow
[16:11:53] <StephenLynx> and it becomes slower for the more you skip
[16:12:05] <sabrehagen> what method do you use to page through your data then?
[16:12:14] <StephenLynx> well, since it is a chan
[16:12:19] <StephenLynx> content is deleted often
[16:12:21] <StephenLynx> like threads
[16:12:41] <StephenLynx> so a board will never more than a couple hundred of threads
[16:12:54] <StephenLynx> so skipping through the results is not an issue
[16:12:57] <StephenLynx> not to mention
[16:13:04] <StephenLynx> that pages are generated on a queue
[16:13:07] <StephenLynx> and not on demand
[16:13:20] <StephenLynx> when inside a thread I don't have to skip or limit anyway
[16:13:31] <sabrehagen> you should do a writeup on your architecture.
[16:13:38] <StephenLynx> so skipping is not an issue for this system.
[16:13:40] <StephenLynx> however
[16:13:43] <StephenLynx> on the logs page
[16:13:48] <sabrehagen> a full blog post discussing your design choices would be fascinating.
[16:13:58] <StephenLynx> I intend to remove the skipping
[16:14:10] <StephenLynx> because the logs might achieve numbers.
[16:14:14] <StephenLynx> and they are not deleted
[16:14:22] <StephenLynx> I could do that.
[16:14:23] <StephenLynx> but
[16:14:33] <StephenLynx> I don't care, you know?
[16:14:46] <StephenLynx> I am not connected with the community.
[16:14:54] <StephenLynx> specially the js/node/web community.
[16:15:37] <sabrehagen> just document how all the components of the system interact. the software deserves it.
[16:15:44] <StephenLynx> that is already done.
[16:15:58] <StephenLynx> doc/Engine.txt
[16:16:22] <sabrehagen> just found that. it will be an interesting read.
[16:16:23] <StephenLynx> I just haven't updated it after I wrote, but the architecture haven't changed either.
[16:16:44] <sabrehagen> whs this written as a plan before you began coding?
[16:16:48] <StephenLynx> no
[16:16:49] <StephenLynx> after.
[16:16:59] <StephenLynx> I didn't planned ahead.
[16:17:08] <StephenLynx> aside from very few stuff
[16:17:23] <StephenLynx> like saving files on gridfs, having a queue to generate pages
[16:17:39] <StephenLynx> I did refactor a lot though.
[16:18:08] <StephenLynx> some parts became very messy with this organic growth, like the upload handling logic.
[16:18:15] <StephenLynx> and I realized a pattern too.
[16:18:25] <StephenLynx> the asynchronous recursion pattern.
[16:18:39] <StephenLynx> and applied it to the upload handling logic.
[16:19:24] <StephenLynx> if you have interest in the project, I got a channel on rizon.irg
[16:19:28] <StephenLynx> .irc*
[16:19:30] <StephenLynx> #lynxchan
[16:20:24] <sabrehagen> will keep it in mind.
[16:21:52] <sabrehagen> StephenLynx: do you have any cases where you have issues with concurrent updates to the same document?
[16:21:57] <StephenLynx> no
[16:22:04] <StephenLynx> afaik mongo handles that.
[16:22:16] <StephenLynx> and I don't have documents that are updated often anyway
[16:22:46] <sabrehagen> can two people ever edit the same document?
[16:22:56] <StephenLynx> threads are updated on every reply, boards are updated on every post, but it doesn't keep the operation from completing
[16:22:57] <StephenLynx> yes.
[16:22:59] <StephenLynx> they could.
[16:23:12] <StephenLynx> two mods could edit the same post.
[16:23:32] <sabrehagen> how do you handle the case of the first mod's save getting overwritten by the second mod's value?
[16:23:36] <StephenLynx> I don't.
[16:23:55] <StephenLynx> the value is completely overwritten by the second mod.
[16:24:21] <saml> implement versionnig
[16:24:24] <StephenLynx> no
[16:24:33] <saml> for cms, you need versioning
[16:24:38] <StephenLynx> is not an cms
[16:24:40] <StephenLynx> a cms*
[16:24:51] <saml> cms solves all business problems
[16:24:58] <StephenLynx> it doesn't solve mine.
[16:25:51] <StephenLynx> the post will say the name of the person that edited it the last time and the time of the edit.
[16:25:55] <StephenLynx> that is enough.
[16:27:34] <sabrehagen> what do you do by day?
[16:27:42] <StephenLynx> my job?
[16:27:51] <StephenLynx> software developer
[16:28:04] <StephenLynx> but lately I have been working on lynxchan because there is nothing for me to do
[16:28:20] <StephenLynx> I am the guy that gets shit done that no one else could.
[16:28:39] <sabrehagen> what software do you write for work?
[16:28:56] <StephenLynx> a real-time chat back-end, a C software that reads input from a serial port connected to lab equipment
[16:29:06] <StephenLynx> there was an android app for a convention when I got in too
[16:29:25] <StephenLynx> these are the 3 main projects I developed here in a little more than a year
[16:29:34] <sabrehagen> how many devs are there?
[16:29:37] <StephenLynx> dunno
[16:29:48] <StephenLynx> I am the only one at this office, but in the main office there are more
[16:29:48] <sabrehagen> 3? 30? 300? 3000?
[16:29:49] <StephenLynx> 4 or 8
[16:30:16] <StephenLynx> i more stuff than that, but small stuff
[16:30:21] <StephenLynx> I did more*
[16:30:28] <StephenLynx> like some web fe work on a system
[16:30:35] <StephenLynx> but I absolutely loathed
[16:30:40] <sabrehagen> are there any other good developers there?
[16:30:45] <StephenLynx> I don't think so.
[16:30:48] <StephenLynx> not from what I seen
[16:31:07] <StephenLynx> but I might have not seen something yet.
[16:31:11] <sabrehagen> are you the youngest?
[16:31:15] <StephenLynx> I think so.
[16:31:19] <StephenLynx> 26
[16:31:45] <StephenLynx> the guys I have seen are not the worse I have seen either.
[16:31:57] <sabrehagen> are you challenged by the job?
[16:32:04] <StephenLynx> somewhat.
[16:32:16] <StephenLynx> it was quite a challenge writing that C software
[16:32:25] <sabrehagen> in what respect?
[16:32:29] <StephenLynx> and a mild challenge to write the real time chat.
[16:32:42] <StephenLynx> the android app was just a matter of time restraint
[16:32:50] <StephenLynx> as in most small business
[16:32:57] <StephenLynx> you don't know what you will have to develop.
[16:33:19] <StephenLynx> so you are always having to learn something new and doing something you never did before
[16:34:36] <StephenLynx> the C software was mostly challenging because I had no idea on any of the involved aspects. I had no idea how raspPis were, I had no idea what was the interface the equipment used, I had no idea on how to use serial ports
[16:34:51] <StephenLynx> I just had some C++ knowledge, so learning what I had to learn from C was not hard
[16:35:29] <sabrehagen> tgis was the serial port comms?
[16:35:36] <StephenLynx> no
[16:35:38] <sabrehagen> *this
[16:35:40] <StephenLynx> ttyAMA0
[16:35:43] <StephenLynx> ah
[16:35:44] <StephenLynx> yes
[16:36:20] <StephenLynx> but in the end everything turned out great and I believe I secured my job on that project.
[16:36:32] <StephenLynx> I suggested him not using C, but my boss wanted C so
[16:36:48] <StephenLynx> now I don't think anyone else can maintain it because it is in C
[16:36:54] <StephenLynx> but oh well
[16:37:12] <StephenLynx> ¯\_(ツ)_/¯
[16:37:26] <sabrehagen> where was the software to be used?
[16:37:50] <StephenLynx> in raspPis connected to lab equipment to fetch the medical results
[16:38:42] <StephenLynx> it will run as a service, saving the content in files and sending them to feed the system
[16:39:07] <StephenLynx> so doctors will receive the results ASAP through a mobile app
[16:40:28] <sabrehagen> what language would you have used?
[16:40:56] <StephenLynx> python, because of the raspPi interface
[16:41:10] <StephenLynx> or so I heard it uses python
[16:42:14] <sabrehagen> with you experience in node now, would you choose to use node on the pi?
[16:42:47] <StephenLynx> no
[16:42:59] <StephenLynx> it takes about
[16:43:06] <StephenLynx> 15 minutes to compile on an i5
[16:43:11] <StephenLynx> and 9bm RAM idle
[16:43:42] <StephenLynx> about io.js
[16:43:52] <StephenLynx> haven't used node since i dunno, 0.10
[16:44:05] <StephenLynx> but I don't think it is much better by now
[16:45:02] <sabrehagen> that sounds like a nightmare.
[16:45:17] <StephenLynx> yeah, imagine compiling that on a raspPi
[16:45:44] <StephenLynx> I even considered at some point trying, but I didn't like the idea because of that.
[16:46:27] <StephenLynx> besides, if you are just going to use node/io as a general purpose scripting runtime environment, you might as well use something else meant to be used for that.
[16:46:55] <StephenLynx> you wouldn't use the single strongest point of it: handling high levels of concurrency.
[16:47:12] <StephenLynx> I tried bash
[16:47:34] <StephenLynx> but its extremely high-level behavior regarding serial ports screwed up everything
[16:47:35] <sabrehagen> how did that go?
[16:47:40] <sabrehagen> right.
[16:47:57] <Derick> try compiling MongoDB ;-)
[16:48:11] <StephenLynx> I believe node/io would fit the part where you have low-level access.
[16:48:24] <StephenLynx> but you would have to build from source
[16:49:07] <Derick> ehershey: you alright? :)
[16:49:35] <ehershey> fighting with irssi :)
[16:49:42] <ehershey> it's a losing battle
[16:49:45] <ehershey> 3.0.6 is out!
[16:49:50] <Derick> yay
[17:29:29] <Lujeni> Hello - There is a step to propose a new Third-Party Open-Source Tools on mongodb documentation ? Thx
[17:30:50] <StephenLynx> I don't think 3.0.6 is out on centOS repository from 10gen
[17:30:54] <StephenLynx> welp
[17:32:17] <christo_m> hello, im trying to do an autocomplete on movies and shows, should i be storing these as separate collections in my mongodb?
[17:32:27] <christo_m> would it be slower querying both collections?
[19:28:05] <Pinkamena_D> I am looking for an idea to solve this problem. I have a collection with docs with array values: [a, b, c, d]. I have an array of values and I want to query for documents where all of the document's array values are a match but there can be extra. For example [a,b,c] and [a,b,d,e,f,g] should not match but [a,b,c,d] or [a,b,c,d,e] will match.
[19:31:50] <StephenLynx> ok, so what you need is "give me all that contains AT LEAST all of these elements?"
[19:32:51] <doc_tuna> ehershey: irssi is the client of the future
[19:32:59] <doc_tuna> i'll be here, in the future, waiting for you
[19:34:42] <ehershey> the problem is it's also the client of the past
[19:34:50] <ehershey> so I'm stuck in the past
[19:34:55] <ehershey> maybe someday we'll be able to meet
[19:34:59] <ehershey> I guess this was it happening right now
[19:38:53] <Pinkamena_D> StephenLynx, yes
[19:39:53] <StephenLynx> http://docs.mongodb.org/manual/reference/operator/query/elemMatch/#op._S_elemMatch
[19:40:13] <StephenLynx> I think $elemMatch:{$in:[a,b]} would work
[19:40:18] <StephenLynx> wait
[19:40:21] <StephenLynx> I don't think so
[19:41:43] <StephenLynx> http://docs.mongodb.org/v3.0/reference/operator/query/all/
[19:41:44] <StephenLynx> here
[19:42:09] <StephenLynx> $all would do exactly what you need
[19:42:48] <Pinkamena_D> No, not quite, I guess I misspoke
[19:43:09] <Pinkamena_D> The "all" part needs to be the items in the document, not the items in the query.
[19:43:33] <Pinkamena_D> All of the items in the document need to match something in the query, but the query can have extra items in it
[19:43:49] <Pinkamena_D> I guess it is the opposite of normal usage.
[19:46:14] <StephenLynx> ah
[19:47:03] <StephenLynx> then I guess you need elemMatch
[19:47:32] <StephenLynx> it will try to do that, make sure every element matches something in the array
[20:17:26] <deathanchor> the forever recovering curse....
[20:17:37] <deathanchor> which it will never recover from.
[20:19:46] <Pinkamena_D> StephenLynx, thanks, I got it going with $elemMatch combined with $in.
[20:45:38] <daidoji> anyone got any one-liner queries I can use to find all unique keys in all documents containing a string?
[20:45:48] <daidoji> like all keys containing string 'foo' in key name?
[20:46:54] <StephenLynx> db.col.find({foo:{$exists:true}})
[20:47:11] <StephenLynx> wait
[20:47:20] <StephenLynx> I don't think you can do that.
[21:03:41] <synthmeat> heya, a quick question.. it's mongoose, but i doubt that's relevant... http://pastie.org/private/uwn3l9ohodlirdg4dvsoa
[21:04:04] <synthmeat> is there any way to get this not to overwrite all other { platform: { whatever } }?
[21:04:31] <synthmeat> this way, i successfully update 'facebook' bit of the object tree, but it deletes anything else in 'platform' beside it
[21:14:08] <synthmeat> nvm, got it :)
[22:06:58] <silasbarta> So … on mongo v3, how do you dump all collections in a database?
[22:07:11] <diegoaguilar> you should do a script
[22:07:29] <silasbarta> so I can’t just do mongodump?
[22:07:58] <cheeser> mongodump works just fine
[22:08:01] <silasbarta> I had it set up that way in 2.4 where a user had readWrite and userAdmin roles, and it worked
[22:08:02] <diegoaguilar> mongodump is per database
[22:08:06] <diegoaguilar> ohh u said all collections
[22:08:07] <diegoaguilar> sorry
[22:08:13] <diegoaguilar> I though database
[22:08:18] <diegoaguilar> yeah mongodump is fine
[22:08:21] <cheeser> you can dump all collections or specific collections
[22:08:34] <silasbarta> but I upgraded to 3, tried to dump the database, and it says I don’t have permissions
[22:08:38] <silasbarta> it worked perfectly fine before
[22:09:20] <silasbarta> the command was `mongodump --port='8501' --username 'useradmin' --password '<password>' --db 'central' --out outputfile`
[22:09:46] <silasbarta> that gave me all the collections in `central`. User roles were readWrite, userAdmin
[22:09:59] <silasbarta> Now the mongo db is upgraded to 2.4 and it says I’m not authorized
[22:10:20] <silasbarta> er, I mean upgraded from 2.4 to 3.0
[22:11:23] <silasbarta> Anyone know what’s going on?
[22:13:34] <silasbarta> Did anyone see my questions about dumping a DB?
[22:14:12] <diegoaguilar> silasbarta, dont u have to use --authenticationDatabase
[22:14:12] <diegoaguilar> ?
[22:14:46] <silasbarta> ah, that would make sense … to have one db for auth and the other for what database I actually want to dump
[22:15:33] <silasbarta> wait, that looks like it’s just for when I’m using an external authentication deal
[22:15:51] <silasbarta> but it looks like —excludeCollection is what I want so I don’t dump the user and so don’t need higher permissions
[22:15:56] <silasbarta> let me give that a twirl
[22:16:28] <silasbarta> that means “test it” for those of who you don’t know common English idioms or dislike them
[22:44:36] <silasbarta> hm, looks like the —excludeCollection is the way to go