[00:05:59] <FrenchieUser12> looks like the problem is with my insertion
[00:13:20] <GothAlice> FrenchieUser12: Note that "collection" in my examples is meant to be the name of whatever your actual collection is; the one storing the data you are trying to retrieve. If you are find_one'ing on a collection different from the one you are inserting into, you can't expect it to work. ;)
[00:13:45] <GothAlice> (In the case of my interactive shell example, the name of the collection I inserted into _and_ read from was "collection". Apologies if that was unduly confusing.)
[08:44:56] <jeanre> why would total be 0 in this case http://pastie.org/private/xuunqlqmjns2nhh0jfj8a
[08:46:00] <jeanre> even though totalBytes in the documents have data
[08:46:42] <jeanre> I think because totalBytes dataType is a string?
[13:05:14] <brainer> hello i'm just verifying if my registration is complete:)
[13:09:00] <brano543> hello, i am trying to update document and i want to add a field pois with array of objects but with no success,nothing gets added. if i try to add just array of integers,it works,but not with array of objects. I am doing BSON("$set" << BSON("pois" << pois.arr())) Can anyone help me?
[13:10:52] <StephenLynx> what language and tools are you using?
[13:11:13] <StephenLynx> I don't recall anyone using directly "BSON".
[13:11:31] <brano543> StephenLynx: i am using c++ driver. full syntax mongo.update("data.vrcholy", BSON("_id" << n_id), BSON("$set" << BSON("pois" << pois.arr())) );
[13:11:59] <brano543> StephenLynx: second parameter is query, third one is what to update
[13:12:15] <StephenLynx> have you tried to perform your operation on the shell first to make sure your logic checks?
[13:13:00] <brano543> StephenLynx: okay i can try it
[13:18:06] <brano543> StephenLynx: this works in console db.vrcholy.update( {"_id":3039828758},{$set:{"pois":[{"test":"testval"}]}})
[13:19:47] <brano543> StephenLynx: i don t know what am i doing wrong,i am creating array of objects,see https://dpaste.de/fFWH
[13:20:01] <StephenLynx> no idea, I have never used the C++ driver.
[13:20:08] <StephenLynx> you will have to dig its documentation.
[13:20:18] <StephenLynx> but at least now you are sure your query is ok :v
[13:22:33] <brano543> StephenLynx: strange thing is when i created objects exactly the same and used isnert it got inserted properly.....
[13:54:00] <brano543> StephenLynx: its strange, i am creating exactly same object as in console and it doesn´t update it
[13:55:50] <StephenLynx> more than often lower level tools will require you to learn their intricacies
[14:12:19] <brano543> StephenLynx: can it be the c++ driver doesnt support that?
[14:12:37] <brano543> StephenLynx: i have tried everything from examples and it doesn´t work
[14:53:42] <StephenLynx> brano543 I doubt it, that is a basic operation, to set a field with an fixed array.
[14:55:30] <brano543> StephenLynx: this is ridiculous,i have even tried to specify the multi option and it still doesnt work i have followed this http://www.slideshare.net/YnonPerek/mongodb-for-c-developers
[14:56:05] <StephenLynx> have you read the documentation and the driver's source code?
[14:56:28] <brano543> StephenLynx: i have read everythin i have found on that side and on official mongo site
[14:56:47] <StephenLynx> there is a reason lower level languages are not on the bottom shelf of most programmers ¯\_(ツ)_/¯
[14:57:22] <StephenLynx> http://docs.mongodb.org/ecosystem/drivers/cpp/ have you read this?
[14:58:41] <brano543> yes,this is what i have read about 1000 times in the last 2 hours
[15:33:16] <brano543> StephenLynx: it was there before,but i forgot it was sometimes empty
[15:33:28] <StephenLynx> yeah, GUI managers are bad for mongo.
[15:33:37] <brano543> StephenLynx: now its only present on those objects i updated
[15:34:29] <brano543> StephenLynx: you know , i need to optimize my importer to DB,because i can´t keep all the data in memory, so i insert into DB and then query
[15:53:59] <brano543> StephenLynx: can you please explain me the WriteConcern? Somehow i don´t see an option there to report me if any errors happened during the bulk update operations
[15:54:12] <StephenLynx> no idea, I just use the default wc
[15:55:58] <brano543> i also use the default wc,but where do you check for errors if any occured?
[15:56:54] <StephenLynx> I use the node.js driver, it returns me an error object as the first parameter of the callback.
[15:57:17] <StephenLynx> it is null if none occurred.
[15:57:35] <brano543> StephenLynx: i hate node.js, someone helped me to get it working here last time
[16:00:06] <StephenLynx> you really can't blame a technology for your ineptitude.
[16:02:03] <brano543> my problem is i don´t understand how it works,i saw soem examples, someone even told me why do i call connect DB on every request,answer because i don´t understand this :( i dont know how to create global variable connection,there make connect to DB and for everz querz call it like i do it in c++ https://dpaste.de/q4hi
[16:03:03] <StephenLynx> you don't understanding something doesn't mean the technology is bad or messed. if you have discipline, callbacks are no more complicated than other forms of abstraction, such as interfaces or multiple inheritance.
[16:03:36] <StephenLynx> specially if you are a newbie.
[16:03:39] <brano543> can you point me to some materials or fix me that connect to make it global?
[16:03:58] <StephenLynx> make a class and implement a static method that holds the connection.
[16:04:24] <StephenLynx> and another static method that initializes the connection.
[16:05:18] <StephenLynx> a web back-end that takes http requests?
[16:05:42] <brano543> can you show me some example please? my project is routing application, i have node.js server which processes queries and communicates with c++ wchich actually searches the graph and sends back JSON
[16:06:13] <StephenLynx> using C++ in the middle of that is an awful idea.
[16:06:23] <StephenLynx> and I would change node.js for io.js.
[16:06:38] <StephenLynx> and just look for static methods in C++
[16:07:27] <StephenLynx> javascript has built-in json support, you literally has to do nothing to add a js object to mongo.
[16:08:12] <StephenLynx> with javascript you can just initialize an object using var myObject = {a:'banana', b: [1,5,6]}; and then add myObject to mongo.
[16:08:19] <jaitaiwan> Hey StephenLynx... awhile back you sent me a link to one of your projects which contained awesomely formatted JS and a suggestion of a book to read. Any chance you remember that stuff still?
[16:08:42] <brano543> StephenLynx: hmm,but even if the graph is stored in DB and zou can query nodes, you don´t have fast enough implementations of priority queue compared to c++
[16:09:01] <brano543> StephenLynx: that io.js is something like node.js?
[16:09:12] <StephenLynx> it is a much better and faster fork of it.
[16:09:19] <StephenLynx> all of maintainers are working on it.
[16:09:33] <StephenLynx> there is absolutely zero reason to use node.js instead of it.
[16:10:03] <jaitaiwan> StephenLynx: I can't remember but it had something to do with not writing bad code because Bad code is what causes callback and promise hell
[16:10:12] <StephenLynx> and if you are using a graph, then perhaps mongo is not the best tool for the jobs, there are dbs dedicated to graphs.
[16:10:49] <StephenLynx> unless you are writing native code or using native modules, it is a drop in replacement.
[16:11:06] <StephenLynx> https://gitlab.com/mrseth/bck_lynxhub this is my project and
[16:11:32] <StephenLynx> hold on, looking for the code guidelines.
[16:11:46] <StephenLynx> https://github.com/felixge/node-style-guide here
[16:13:44] <brano543> StephenLynx: thank you, i will definitely check that out. i see, io.js works the same way as node.js, i updated the dependencies with npm update anyways
[16:15:13] <StephenLynx> for you I can direct you to https://iojs.org/en/index.html and https://github.com/iojs/io.js
[16:16:29] <brano543> StephenLynx: thanks,i will need a time to process it. for now, i am trying to make those updates i struggled with today as bulk operation :)
[16:18:41] <StephenLynx> also, I suggest not using windows.
[16:18:52] <StephenLynx> specially if you are running an actual server.
[16:19:43] <StephenLynx> running a windows server is a laughably bad idea, and you are better developing in the environment that will be the one on the server.
[16:20:00] <StephenLynx> so not much point into headbashing to make stuff work properly under windows.
[16:21:03] <brano543> StephenLynx: its fine for me, the importer will work on windows,its easier, the server may work on windows. I am not experienced enough to provide all the dashes for clients needed to compile the dependencies under linux :D i am just a student haha
[16:21:37] <StephenLynx> npm takes care of dependencies.
[16:21:59] <brano543> i mean the c++ code of my application
[16:22:14] <StephenLynx> that shouldn't be there in the first place.
[16:22:48] <StephenLynx> because node was built to take care of the queue from the ground up.
[16:23:03] <StephenLynx> do you actually have a benchmark to prove that C++ will provide a gain in your case?
[16:23:08] <brano543> i am talking about the priority queue needed for the A* search
[16:23:37] <StephenLynx> so why you are dealing with the database in your C++ code?
[16:23:59] <brano543> StephenLynx: i need to initially preprocess data
[16:24:49] <brano543> StephenLynx: i am also thinking about on-the-flz approch,that the function succesor(node) will query DB so i don´t need to keep the graph entirely in memory
[16:35:06] <PedroDiogo> (as I am a total mongodb noob)
[16:35:36] <StephenLynx> but again, as everything that is important, will not work very well on windows because it is an useless pile of radioactive trash.
[16:35:46] <PedroDiogo> is it wise to use one single model in mongodb for my whole application ?
[16:39:24] <PedroDiogo> for this, I'm using a single Schema on my nodejs app for messages only with from, to, message, timestamp and lastRead parameters
[16:39:45] <StephenLynx> use io.js instead of node.
[16:39:57] <StephenLynx> it is everything node is but more, better and faster.
[16:40:03] <PedroDiogo> so I just query 'to' and 'from' to get the needed messages
[16:40:08] <StephenLynx> and you mentioned schema? are you using mongoose?
[16:49:46] <StephenLynx> and I have another project developed at my company that is exactly what you are doing, a 1x1 chat.
[16:49:57] <PedroDiogo> it is a real time web app with a REST web service bellow where I need to pass and receive special JSON to different services and the front end as well
[16:50:11] <StephenLynx> yeah, I use JSON too for my requests and responses.
[16:50:22] <StephenLynx> you just grab the request body and parse using json.
[16:50:35] <StephenLynx> again, you don't need a bloated and slow framework for that.
[16:50:42] <StephenLynx> they add LITERALLY zero functionalities.
[16:51:02] <PedroDiogo> yeah I know, but I actually like the express way of doing things with modules, routes and all that. It eases the workflow with my colleagues
[16:51:21] <StephenLynx> well, if you LIKE using bad technology, then I have no arguments for that.
[16:51:41] <PedroDiogo> i understand it may slow things down a bit (I really do - I'm new to node.js and mongo, but not a new programmer), but, for this project, I must do so
[17:06:13] <StephenLynx> object data model I guess.
[17:07:58] <StephenLynx> it creates a clusterfuck so you have to type a little less and makes your code dependent on it forever so you can say you use hip technologies which is not a problem since you won't have to maintain the project after you lose your job.
[17:12:22] <PedroDiogo> I've created my own job, so no problems there...yet!
[17:13:48] <PedroDiogo> thinking of going with linode for the MMS solution - any word on them?
[17:42:31] <PedroDiogo> this is mongoose's schema: https://gist.github.com/PedroDank/f2932c0f1f297da8437f
[17:43:35] <PedroDiogo> no idea why it keeps saving __v
[17:58:48] <Diegao> hi, I would like to compare two collections (one original and its copy) to get the different records
[17:59:27] <Diegao> these two collections were generated in different scenarios, so I would like to see the difference between then
[18:10:32] <chairmanmow> I'm trying to update a record and push to two arrays inside the document. I've done it successfully with one array, but the second one doesn't get pushed, and mongo doesn't throw an error. Is there anything glaringly wrong with this syntax ? : Item.update({_id:updateQuery.item._id},{$push:{logs: updateQuery.logToPush, assignments:updateQuery.assignmentToPush}}
[19:34:42] <GothAlice> Unfortunately to get there it literally has to replay every step to build up the final result; it's not like a video file with keyframes, here.
[19:36:42] <StephenLynx> yeah, it would require a little effort.
[19:36:54] <StephenLynx> but being forced to wait to the end is kind of a weak point.
[19:37:05] <GothAlice> Not if slowing people down is the purpose. :)
[19:37:06] <StephenLynx> at least to get it safely to the end
[19:37:17] <GothAlice> If I wanted to demo something fast, I'd gist it.
[19:37:29] <StephenLynx> if people just alt+f4 and start demonizing the site, then it will never take off.
[19:37:33] <StephenLynx> because they had to wait.
[19:37:56] <StephenLynx> making the wait mandatory is kind of bad.
[19:40:23] <GothAlice> StephenLynx: It's not my site.
[19:52:00] <GothAlice> The difficulty I have: I enjoy a _good_ argument. Aw snap. ;)
[19:52:43] <GothAlice> (Saying something is unbearably slow when the whole point is for it to be slow a good argument does not make.)
[20:06:37] <pjammer> if mongod process was using 75%+ cpu and then dropped to under 1%, yet currentOp() didn't have anything in it... can i find out why the sudden drop occured?
[20:07:08] <GothAlice> pjammer: If you have "slowMs" profiling enabled, the query/op that caused the spike may appear in your logs.
[20:07:29] <GothAlice> If you don't have that profiling level (I believe it's 1) enabled, it likely won't show.
[20:08:42] <pjammer> it's been sucking that cpu % since the weekend, after we killed some Index job (long story) but i've been checking currentOp for days and it's been blank with no queries.
[20:08:57] <pjammer> so it's strange. like it would show up in currentOp right?
[20:09:16] <GothAlice> Aye; a background index operation would show up in the list of active operations… if that's what it was doing.
[20:09:23] <pjammer> and thanks @GothAlice checking.
[20:09:29] <GothAlice> High apparent CPU load can also be caused by extreme IO lag.
[20:10:02] <pjammer> and to see what causes this extreme IO lag? i'm at a loss here right now.
[20:10:13] <pjammer> just inherited the box so i'm all ears to anything
[20:10:19] <GothAlice> htop/iotop/iftop are your friends.
[20:10:41] <pjammer> yeah i ran top but it was just mongod rocking the resources
[20:10:49] <GothAlice> htop breaks things down by thread.
[20:10:55] <GothAlice> (Amongst many, many other goodies.)
[20:11:06] <GothAlice> iotop breaks IO utilization down by device.
[20:11:13] <pjammer> will be installing top let me down for the last time.
[21:59:45] <harttho> Is there a command to get the size of all databases (or only 1 at a time)?
[22:04:53] <GothAlice> harttho: http://docs.mongodb.org/manual/reference/method/db.collection.stats/ will get you stats by collection, http://docs.mongodb.org/manual/reference/method/db.stats/ for a whole database at once.
[22:06:24] <harttho> GothAlice: Thanks, I guess I do see the reason that another level up doesn't exist haha
[22:06:24] <GothAlice> If you're looking for the on-disk size of all, you can just sum those up from the files on disk. (du --total) Otherwise, you'll have to iteratively collect each DB's stats and aggregate.
[22:51:12] <pjammer> Single master... when is the right time to switch to replication if you want reads to always be available when called from your web app. i have stats to aid the convo too
[22:55:10] <GothAlice> If you want high-availability, you want a replica set. So… immediately? :)
[22:56:21] <pjammer> heh, so true. i'd even take 'before the outage'
[22:57:27] <pjammer> if an existing /data directory is owned by root, will changing ownership to mongodb, mess it up, for lack of a better word?
[22:57:54] <pjammer> I'm trying to eventually get an automation agent on this existing build
[22:58:09] <cheeser> eventually? install it today!
[22:58:13] <GothAlice> You'll need to restart the process as the correct user anyway, so step 1: stop the mms processes, step 2: chown, step 3: re-start as the mongodb user.
[22:59:00] <pjammer> but no automation, that's how old school we are.
[23:10:31] <pjammer> so in mms Btree and Journal Stats both took nosedives, and then my Queues, Opscounters,Background Flush Avg all went down to normal or 0 levels.
[23:11:12] <pjammer> how do i decifer what that means? #you_are_my_only_hope
[23:11:22] <pjammer> decipher if we're being pedantic
[23:12:00] <pjammer> i got a fancy graph, and will make cookies.