[04:50:25] <rk18> Hello, I am making my first MongoDB app with express.js and node.js
[04:51:30] <rk18> my problem is: i use the find method to retrieve a particular value from the database, and when i convert the cursor to an array and pass a callback function, i try to save the result in a global variable
[04:52:01] <rk18> however, when i console.log the global variable, the value of the variable that i assigned a value from the database to shows up as undefined.
[04:52:25] <rk18> any suggestions on what could be wrong? I console log outside of the .find method callback function
[04:55:15] <Boomtime> @rk18: this is in node.js? it sounds like you have a concurrency problem - the find probably hasn't completed at the time you check your global variable
[04:56:35] <rk18> i noticed the console of the global variables value occurs first before the console logs inside the callback, even though i check the value of the variable outside of the callback
[04:57:36] <rk18> _nextCounterVal = _counters.find({name:"main"}).toArray(function(err,db) { if (err) throw err; console.log('here is the damn d.b', db,db.value,db[0].value); res.send(db[0].value); }); console.log("counter val", _nextCounterVal);
[04:58:52] <Boomtime> @rk18: node is event driven, you don't issue commands directly, you 'stack up' things you want done and the callback function is called when that task completes - what would be the point of the callback if the operation was complete immediately?
[04:59:24] <Boomtime> please note, this isn't mongodb related - you are learning node.js by the solunds of it
[08:17:44] <m3t4lukas> hey guys :) I wanted to ask whether anyone of you already did a mongodb connector for postfix and dovecot?
[08:23:47] <m3t4lukas> it seems to be more complicated since db_common is not really made for working with anything else but SQL.
[08:29:34] <m3t4lukas> but what needs to be done needs to be done. It can't be that there is no such thing like no mails stored in mongodb :P
[08:30:24] <m3t4lukas> *that there is no such thing like storing mails in mongodb
[10:53:01] <themroc> hi, i guess you already know that the packages signatures are invalid on the debian repository at http://repo.mongodb.org/apt/debian/dists/wheezy/mongodb-org/stable/ ?
[11:04:07] <themroc> ah yes that's https://jira.mongodb.org/browse/SERVER-22144 ; packages signatures were fine yesterday before the release of 3.2.1, so i guess this is related to the release of the new version.
[11:47:11] <aps> I'm really disappointed with recent MongoDB releases. Normally, one would hope that upgrading a package would make it better. It gets worse in this case. I upgraded my prod mongo servers from 3.0.8 to 3.2 and all hell broke loose.
[11:50:26] <aps> In other replica-set, I just added a secondary of version 3.2 to a replica set running 3.0.8. It sky-rocketed the "number of connections".
[11:51:42] <aps> Right most is Mongo 3.2. Second one is primary member. https://usercontent.irccloud-cdn.com/file/RHaLSR04/Screen%20Shot%202016-01-12%20at%205.14.17%20PM.png
[12:05:55] <lipiec> after upgrading from 3.0 to 3.2 in logs i've seen following information:
[12:05:56] <lipiec> 2016-01-12T10:25:41.264+0100 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongod_cache/diagnostic.data'
[12:06:17] <lipiec> what's in that directory? how can i read those binary files inside?
[12:06:50] <StephenLynx> is it coincidence this many people upgraded to 3.2 recently or something happened?
[12:08:18] <lipiec> StephenLynx: I'm just trying to keep up-to-date.
[12:09:29] <StephenLynx> the coincidence just struck me
[12:09:53] <StephenLynx> like, is there any repository that was stuck to 3.0 until now?
[12:10:05] <lipiec> StephenLynx: It's not an issue... It's just a diagnostic information.
[12:10:23] <StephenLynx> what you didnt had before.
[12:10:28] <lipiec> But I'm just curious what's inside those files.
[12:11:00] <lipiec> StephenLynx: OK. I can agree to that. It's something new.
[12:11:10] <lipiec> And I can't find any info in docs about that.
[12:11:54] <aps> I was asked to upload my diagnostic.data to the ticket I filed. I find it weird that I couldn't even see exactly what data I am uploading.
[12:12:37] <lipiec> StephenLynx: But main reason to upgrade was ability to do partial indexes (lots of space can be saved with that feature).
[12:12:55] <lipiec> aps: yeah, it's because they are binary files...
[12:13:16] <lipiec> aps: maybe there is some tool from mongo-org-tools or command in mongo shell to read this?
[12:14:34] <aps> lipiec: I asked around for that, but I was told there's no such publicly available tool. Again weird.
[12:17:34] <Derick> anyway, asking our support team what to do with this
[12:17:44] <Derick> mongodb "diagnostic.data" -- second hit
[12:19:35] <lipiec> Derick: strange, maybe it's because of i'm using polish version of google? https://www.google.pl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=mongodb+%22diagnostic.data%22
[12:20:09] <lipiec> Derick: cause there is no info about docs page in results
[15:22:11] <saira_123> hi boys i want to do a research on mongodb 3.0 performance to write a research paper . can someone guide me what metrics should i use for performance ? any research paper i can refer to?
[15:42:32] <Waitak> It's really tempting to just answer with this: http://bfy.tw/3giG
[15:43:06] <Waitak> (Sorry, I just couldn't resist.)
[16:10:47] <saira_123> Waitak thanks , actually i am looking for an academic research instead of search
[16:12:18] <jetole> Hi guys. I am using db.grantRolesToUser() and than db.getUser("userName") and after I see the permissions in getUser() and than a moment later when I re-run it, the permissions are gone. Can anyone please help?
[16:12:37] <Waitak> saira_123: That's fair. How about this, then? http://bit.ly/22XADPL
[16:14:59] <Waitak> saira_123: One nice technique is to find an earlier article that's in the ballpark, and to look for others that cite it.
[16:15:53] <saira_123> Waitak thanks i am checking "Performance Evaluations of Document-Oriented Databases Using GPU and Cache Structure"
[16:19:32] <Waitak> saira_123: My pleasure. If your focus is Solaris and ZFS, perhaps you could start with some of the literature on other sorts of performance testing on that platform, and see if you can apply it to testing MongoDB.
[16:20:23] <saira_123> Waitak yeah actually that won't be an apple to apple comparison ,
[16:21:48] <Waitak> saira_123: Yes, but performance in a database is all about minimizing disk accesses - particularly avoiding seeks. Performance testing in *any* database, relational or not, boils down to how well you're managing disk access.
[16:22:43] <saira_123> Waitak correct and with mongo this means how well we are managing different types of disk cache like arc cache and page cache
[16:22:50] <Waitak> saira_123: If you have a clear understanding of the idiosyncrasies of ZFS on Solaris regarding general IO-centric performance, you ought to be able to apply that to MongoDB.
[16:24:47] <saira_123> Waitak thanks that not my strong area , yes i will also check on it
[16:25:57] <Waitak> saira_123: I'd focus on that first. (As an aside, I haven't had many conversations like this since I was in academia, which has been a while. This is quite enjoyable.)
[16:26:51] <saira_123> Waitak thanks for your guidance
[17:00:22] <saira_123> Hi Technical professionals if someone is testing mongodb performance , is there any free or 10gen provided server resources where one can test performance freely?
[17:06:14] <cheeser> saira_123: nothing from mongodb, no.
[17:14:45] <magicantler> when i --fork mongos, i'm finding that shell control is not being returned. is there a good workaround?
[17:14:50] <magicantler> --fork works fine for mongod.
[18:07:37] <blizzow> I have three mongo config servers in a sharded replicated cluster. When one of my configs goes down (for upgrade), many of my mongos servers start to wig out and take forever to connect to mongo. I'm assuming mongos is somehow setting a preference to which config server it should connect to. A) am I correct in this assumption? B) How do I get mongos to start querying a different config server faster?
[18:09:35] <saira_123> blizzow the other mongos must be just complaining about the absence of 1 config server but should be performing faster as before
[18:09:46] <idd2d> If I have the following schema, how would I query for the user IDs within a group? http://hastebin.com/avahuhizid.json
[18:51:36] <mapc> cheeser: It seems it might be possible if I do my own locking
[18:52:25] <mapc> I just started around ~100 process trying to read from the same cursor and a couple of them got data
[18:52:42] <mapc> but now I am unsure whether this is horribly unsupported and whether my app will break in two weeks :)
[18:53:05] <cheeser> so it's not about sharing between clients. it's about sharing a client/cursor among threads.
[18:53:16] <cheeser> that's a "simple" threading/locking problem then
[18:53:47] <mapc> cheeser: well I am in python and the goal is to use multi threading, so I can't use threads
[18:53:57] <mapc> If I could use proper threads this would be so easy
[18:54:40] <cheeser> can't help you there. It'd be trivial in java if you feel like rewriting your entire application. :D
[18:55:02] <mapc> So I actually need to opem multiple mongo connections, but of course I still can do locking to ensure only one client at a time does access
[18:55:29] <mapc> cheeser: The first stage of the processing I do wasin C++ and that seems outright simple :D
[18:56:02] <mapc> but yeah, is it defined behaviour to access the cursor from multiple clients, doing my own locking?
[18:58:22] <cheeser> what do you mean by "client?" because to me that means a MongoClient
[19:00:22] <mapc> cheeser: Thanks for the adivse :)
[19:00:42] <cheeser> they're probably close. you're just abstracting a layer too low it sounds
[19:03:04] <mapc> well, I am using mongoengine; the hacking required stuff a different cursor ID into Mongoengine queries is probably less than replacing the entire serialization layer
[19:05:58] <cheeser> you only need the one cursor. one iterator. just multiple consumers.
[19:59:54] <mparm920> Hi I am trying to repair a corrupted database. Upon starting the database I am getting this error 'WiredTiger.turtle: encountered an illegal file format or internal value' I have tried mongod --repair a few different ways and wiretiger wt salvage and help would be apprciated
[21:08:40] <GothAlice> mapc: If you're careful in your BSON document construction, you can map BSON blobs directly to packed C structures and avoid deserialization completely. :P
[21:09:00] <GothAlice> "Deserialize" becomes "pointer dereference with a cast". :P
[21:10:11] <mapc> GothAlice: thank you for that hint! that could be very useful
[21:10:31] <GothAlice> Er, not advised, but technically possible. Just avoid variable-sized types, or only have the last element variable sized. :P
[21:11:24] <mapc> GothAlice: Interestingly, my application is conversion from Dbase, so I can in general arange a fixed size, because my input data is entirely fixed size
[21:11:51] <mapc> any idea whether this is possible the other way around? My application spends most of it's time encodeing bson
[21:12:44] <GothAlice> Ah, MongoDB doesn't have a CHAR type, only variable-length (often Pascal-style length prefixed) UTF-8 strings. If any of your data is text, fixed sizes across the board becomes much harder to manage without explicit padding.
[21:12:45] <mapc> or at least the C++ part does that most of the time
[21:13:09] <mapc> GothAlice: I could do padding ^^
[22:38:35] <cbx33> Hi all, need a little help with aggregate, I have a number of records that have identical "name" fields, and they have a "status" field. What I want to return is the latest, there is a "finish_time" field, record for each unique "name"