PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 25th of March, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:06:57] <joannac> ehershey: should I set the channel +r then?
[00:07:27] <cheeser> that's what ##java is
[00:07:37] <cheeser> people can't join without it and get a message
[00:07:50] <joannac> cheeser: is it warranted? how many people would we lose?
[00:09:55] <ehershey> I didn't add that to the topic
[00:10:00] <ehershey> it's been there for a while
[00:10:03] <ehershey> I thought we already were +r
[00:10:06] <Derick> no
[00:10:17] <Derick> with +r you can't really join
[00:10:23] <Derick> now at leas tyou get a message when you join
[00:10:37] <Derick> i guess i should have put your lot in the cc when I mailed about it
[00:10:56] <ehershey> oh yeah
[00:11:01] <ehershey> that's better
[00:11:01] <joannac> yep :P
[00:11:03] <joannac> brb
[00:11:21] <Derick> we really needed this current mode because of a persistent spammer/abuser
[00:12:11] <ehershey> I like less burden of work on the askers for help and more on us
[00:12:19] <ehershey> but it's not a ton of work to register
[00:12:31] <ehershey> I think I saw the spammer
[00:12:32] <Derick> it requires an email
[00:12:59] <Derick> and this abuser was not the simple troll
[00:20:47] <cheeser> joannac: well, it's hard to say how many tried to join and just gave up. but on the other hand, not having to deal with those who are so unwilling to expend *any* effort at all on their own behalf is its own reward. :)
[00:28:09] <joannac> cheeser: sure :) I'm just going to test this out quickly
[00:29:54] <joannac> lol, mibbit doesn't support freenode
[00:31:13] <joannac> ...that was unexpected
[00:36:49] <joannac> 1. Adium sucks. 2. being unregistered means you can't join or see the topic, so it relies on the user being knowledgeable enough to know what "ridentify with services" means
[00:37:17] <joannac> I dunno if that's too high a bar - thoughts cheeser, derick, ehershey etc?
[00:37:28] <joannac> maybe we should take this to another channel :)
[00:54:54] <GothAlice> joannac: Hmm, it was my impression that one could join, but could not speak unless registered, allowing both the chanserv welcome PM and topic to be shown to the user.
[00:55:33] <GothAlice> (However this may have changed in the backlog I missed. ;)
[00:55:52] <GothAlice> Ah. I see what's going on there.
[00:57:04] <GothAlice> When you set up "registered only" channels, you can specify a dumping ground to deliver unregistered users to. Try joining #python from an unidentified web client, and you'll see what I mean. (You get dumped in ##python-unregistered.) Similarly, right now if you try joining #python-unregistered, you will be directed to #python if you are identified.
[00:57:07] <GothAlice> joannac: ^
[01:01:56] <GothAlice> It's one of the least friendly things to do, though; it's a pretty high and confusing barrier to entry for users for whom IRC is a new tool. S'why ##python-friendly doesn't have that requirement. (I just accept the need for closer monitoring and manual moderation. Being a small channel helps.)
[01:55:34] <cheeser> hasn't really been a problem for ##java
[01:55:50] <cheeser> we get the occasional question but that's it
[01:57:03] <latestbot> Is it possible to do two delete operations in Mongo?
[01:57:36] <latestbot> delete a document from the original table then delete references
[01:58:25] <cheeser> no
[01:58:34] <cheeser> well, yes, but not as a single atomic operation
[01:59:03] <latestbot> what do you mean?
[01:59:14] <latestbot> so I have do that separately?
[01:59:46] <latestbot> I know mongo is not a relational db, so was just wondering
[02:00:37] <cheeser> yes. you have to issue two delete commands
[02:06:08] <GothAlice> latestbot: Due to the race condition that develops because of the split operations, it's important to remember to armour the code that uses the reference against the reference not resolving to a document. (I.e. ignore invalid references when encountered.)
[02:07:31] <GothAlice> The ODM I use, sadly, doesn't do a very graceful job on this task.
[02:12:56] <afroradiohead> database theory-wise, should there only be 1 unique index in a collection/table?
[02:13:09] <afroradiohead> lol what
[02:13:17] <afroradiohead> oops, wrong box
[03:06:59] <Everhusk> Hey, is it possible to do multiple $pullAll updates to one document? my query is not working for some reason when I do
[03:08:30] <Everhusk> db.users.update(
[03:08:31] <Everhusk> {_id: reportedUser},
[03:08:31] <Everhusk> {$pullAll: {'profile.interactions.sent': intIds},
[03:08:32] <Everhusk> $pullAll: {'profile.interactions.receieved': intIds},
[03:08:34] <Everhusk> $pullAll: {'profile.interactions.previous': intIds},
[03:08:36] <Everhusk> }
[03:08:38] <Everhusk> );
[03:08:40] <Everhusk> for example
[03:08:46] <Everhusk> (where intIds is an array)
[03:09:33] <cheeser> 1. use a pastebin. 2. what's the error?
[03:16:20] <Everhusk> http://pastebin.com/HaCH7rUe there is no error, but it doesn't remove any documents like it should either
[03:16:54] <joannac> Everhusk: okay, before and after of a document, then
[03:16:59] <joannac> also, whatever intIds is
[03:21:30] <Everhusk> http://pastebin.com/6EAVFuXH
[03:29:04] <Everhusk> so it should remove 24tRsWzr4wKr2rimC from profile.interactions.sent.. but it's not :(
[03:29:04] <Everhusk> sorry i meant profile.interactions.received*
[03:29:08] <Boomtime>         $pullAll: {'profile.interactions.receieved' <-
[03:29:08] <Boomtime> ?
[03:29:09] <Boomtime> the same spelling is in all the pastbin commands
[03:29:56] <cheeser> i saw that and fixed but it didn't change anything.
[03:30:56] <Boomtime> special, does it work when $pullAll is done individually? (like one $pullAll per update)
[03:31:28] <Everhusk> yes it does
[03:31:45] <Everhusk> and when i do multiple $pullAll then nothing happens
[03:32:46] <Everhusk> and nice catch with the typo :p
[03:33:07] <Boomtime> what version?
[03:40:13] <polydaic> whats the best way of representing a queue in mongodb
[03:40:13] <polydaic> *a queue that is basically a linkedlist
[03:40:13] <Boomtime> holy cow, only the last $pullAll seems to apply...
[03:40:13] <Everhusk> version 2.6
[03:40:13] <Everhusk> yeah.. kinda stumped myself
[03:40:13] <cheeser> yeah. looks that way even on 3.0.1
[03:47:37] <Everhusk> guess it just hit refactor-o-clock
[03:59:24] <polydaic> is it better to do it have it embedded
[03:59:31] <polydaic> or just have references
[04:00:35] <polydaic> for representing a list/array
[05:34:37] <GothAlice> polydaic: http://www.javaworld.com/article/2088406/enterprise-java/how-to-screw-up-your-mongodb-schema-design.html
[05:35:01] <GothAlice> In the case of a queue, it sounds like something that a "capped collection" would suit.
[05:35:25] <GothAlice> Ref: presentation slides and linked code: https://gist.github.com/amcgregor/4207375
[10:33:43] <mazzy> hi. having a replica set in production is highly recommendable? I mean I can put in production a mongodb set without a replica set and guarantee at the same time a good availability of the data?
[10:34:18] <mazzy> in other terms how many have in production a mongodb infrastructure without have enabled replica sets?
[10:39:22] <kali> mazzy: yes, it is very highly recommended to go replica set for production
[10:40:46] <mazzy> in my case I have few resources available in order to deploy a replica set
[10:41:25] <mazzy> I don't have three separated machines but just two
[10:43:12] <mazzy> I'm aware that in order to deploy a replica set I need three different machines where could run primary, secondary and in addition an arbitrer
[11:02:03] <cheeser> you can run the arbiter on the same machine as one of them...
[11:02:28] <cheeser> still, if you're going to production you should spring for an extra machine.
[11:02:45] <cheeser> how are you handling backups? e.g., mms requires you to run a replset for backup.
[11:08:27] <mazzy> I use ebs snapshot @cheeser
[11:08:57] <mazzy> I think I'm going to place arbitrer in the same machine of web server
[11:09:05] <Derick> that's a fair thing to do
[11:09:17] <Derick> as long as your webserver doesn't run a mongod node as well (of course)
[11:09:42] <mazzy> no mongod node runs in two different machines
[11:09:52] <cheeser> sounds fair
[11:10:23] <mazzy> for journal should I reserve two different volumes?
[11:10:53] <mazzy> one for primary and one for secondary?
[12:29:22] <phutchins> Good morning all
[12:30:14] <StephenLynx> that is weird, was I kicked from this channel a while ago?
[12:30:23] <StephenLynx> I let it on auto-join but I wasn't here.
[12:34:19] <dene14> Hello everyone! Is it possible to detect which instance I'm connected to from pymongo driver? (mongos/mongod/configsrv)
[12:34:55] <dene14> especially interested in how to detect whether I've connected to configsrv
[12:39:12] <polydaic> anyone here familiar with mongoose?
[12:39:22] <polydaic> I'm not gettingthe references right
[12:39:29] <polydaic> *not understanding
[13:10:41] <GothAlice> polydaic: People don't become "familiar" with mongoose; they "survive" it. ;P What's your reference issue?
[13:11:12] <StephenLynx> polydaic my knowledge of mongoose is "stay the hell away from it"
[13:13:06] <GothAlice> polydaic: Notably, the 99% most common "reference" issue is Mongoose encouraging users to store ObjectIds as strings. Which means you're more than doubling the required storage space (ObjectId = 12 bytes, the string version = hex encoded, or 24 bytes + 4 byte length + null terminator), and if you accidentally mix ObjectId and string on the same field, bam, you can't query on that field any more.
[13:18:11] <StephenLynx> the funny part is that mongoose is developed by mongo inc.
[13:18:20] <StephenLynx> you would expect it to not be complete cancer.
[13:19:19] <GothAlice> StephenLynx: https://github.com/Automattic/mongoose © 2010 LearnBoost
[13:19:28] <GothAlice> Don't think it's 10gen/MongoDB.com doing this nonsense.
[13:19:44] <StephenLynx> I think I got it wrong then :v
[13:20:11] <GothAlice> 10gen/MongoDB.com do the official low-level drivers. Really, that's all most people need, anyway. ;)
[13:20:39] <GothAlice> (Even *I* pop down to raw pymongo, sometimes even mixed into my other ODM-backed code.)
[13:26:32] <StephenLynx> I just use the driver.
[13:26:41] <StephenLynx> then I document how the model should be.
[13:27:00] <StephenLynx> you said that was a doubled effort, but since the only reference is the documentation, is not doubled.
[13:30:32] <StephenLynx> tw, GothAlice, do you know a good option for crude hosting for databases?
[13:30:38] <[diecast]> in the createIndex examples I see some fields are quoted and others are not, is there a list of characters that need to be quoted and characters which are not allowed?
[13:30:46] <StephenLynx> I mean, I won't get much RAM and CPU, but lots of space
[13:31:52] <StephenLynx> linode will only give 24gb on the lowest plan
[13:32:19] <StephenLynx> 1tb would cost at least 500 USD / month
[13:32:31] <GothAlice> Cheapest option, truly? Buy or scrounge out of a dumpster a second-hand rack server and colo.
[13:32:43] <GothAlice> "Cloud" is, in general, a way to divorce organizations of their money.
[13:33:08] <GothAlice> For example: my at-home dataset would cost me half a million dollars a month to host on compose.io.
[13:33:14] <StephenLynx> self-hosting is not an option for me.
[13:33:29] <[diecast]> ok, found the doc for naming restrictions - http://docs.mongodb.org/manual/reference/limits/#naming-restrictions
[13:33:30] <StephenLynx> I need it to be elsewhere.
[13:33:55] <GothAlice> StephenLynx: "colo" — "Co-Located Hosting", i.e. they provide the rack, you provide the box.
[13:34:01] <StephenLynx> ah
[13:34:29] <StephenLynx> I don't think I could do that either.
[13:34:32] <StephenLynx> I live in a small town.
[13:34:43] <StephenLynx> I had to laundry my clothes on a river once :v
[13:35:03] <GothAlice> I live in Montréal, Canada (eastern), and have collocated boxes in Vancouver (almost as far west as you can go) and Dallas, Texas. ;P
[13:35:29] <GothAlice> I literally FedEx'd machines to the data centres.
[13:35:45] <cheeser> i'll be in montreal next month!
[13:35:50] <GothAlice> cheeser: Pycon? :D
[13:36:05] <cheeser> taking the family up during the kids' spring breaks
[13:36:17] <StephenLynx> yeah, I would die in taxes and dollar conversion.
[13:36:36] <StephenLynx> 1 USD is over 3 BRL and I make about 3k BRL per month
[13:36:41] <[diecast]> in that doc it says field names can't contain dots, but the following example works - db.serviceMetadata.createIndex({'serviceData.seriesid': 1},{background : true, sparse : true})
[13:36:43] <GothAlice> StephenLynx: I'm not suggesting that you _must_ host in another country or use another currency…
[13:36:57] <GothAlice> [diecast]: That's because a "dot" means "field in an embedded document".
[13:37:01] <StephenLynx> no but I would have to import the hardware
[13:37:10] <StephenLynx> we don't produce hardware here.
[13:37:11] <GothAlice> {serviceData: {seriesid: 1, …}}
[13:37:52] <GothAlice> StephenLynx: Many colo centres let you rent or purchase boxen direct. (Saves a lot of time to provision that way.)
[13:38:08] <StephenLynx> now that is a good option, to rent it.
[13:38:20] <StephenLynx> you got one to suggest?
[13:38:45] <GothAlice> Basically, go cloud if you have the money and the level of trust needed. Do _anything but "cloud"/VPS_ if you want actual guarantees. ;)
[13:38:53] <GothAlice> StephenLynx: USA host?
[13:38:59] <[diecast]> GothAlice: is this the appropriate way to define it? db.serviceMetadata.createIndex({serviceData: {seriesid: 1},{background: true, sparse: true})
[13:39:15] <GothAlice> [diecast]: No. Follow what the documentation provides. The query syntax uses dots.
[13:39:17] <cheeser> [diecast]: no, you just use the dotted name directly
[13:39:25] <StephenLynx> I plan on hosting a linode server for the back-end on texas, so having it close to it would be better
[13:39:38] <cheeser> i just moved off linode actually.
[13:39:47] <StephenLynx> any particular reason? moved to where?
[13:39:47] <cheeser> was too expensive for a mere irc bot :)
[13:39:55] <cheeser> i loved them, though. rock solid.
[13:39:57] <[diecast]> so my previous paste is correct?
[13:40:00] <StephenLynx> I plan on running a forumhub
[13:40:05] <cheeser> [diecast]: yes
[13:40:06] <StephenLynx> but using them for storage is way too expensive
[13:40:29] <[diecast]> then i was confused for the reason GothAlice put "{serviceData: {seriesid: 1, …}}"
[13:40:36] <GothAlice> StephenLynx: I use http://www.fortrustdatacenter.com for my USA dedicated hosts.
[13:41:27] <[diecast]> as an example for field in embedded document, which is something i'm not doing (i think)
[13:41:45] <[diecast]> i'm just starting to learn so excuse me for not being able to keep up ;)
[13:41:59] <GothAlice> [diecast]: That's the underlying structure. The key is: you're querying it, so you need the query syntax. This is also why "." isn't allowed in a real field name, a la: {serviceData: {'series.id': 1}} — that's unintelligible to the query builder. ('serviceData.series.id' becomes ambiguous.)
[13:43:02] <[diecast]> ok so to my original paste, is that not a proper way to build the structure? should i try to break out any "." index names
[13:44:02] <GothAlice> db.serviceMetadata.createIndex({'serviceData.seriesid': 1},{background : true, sparse : true}) — your original query (I believe) is perfectly valid.
[13:44:33] <GothAlice> Because there isn't actually a document with a field named "serviceData.seriesid", but there is an embedded document (or list of embedded documents) named "serviceData" with a field named "seriesid".
[13:45:11] <[diecast]> ok, i understand it is valid. but is it a good practice or should i consider breaking out the "." during the createIndex()
[13:45:21] <GothAlice> [diecast]: Ref: http://docs.mongodb.org/manual/tutorial/query-documents/#embedded-documents
[13:45:32] <[diecast]> ok, i'll read up on that ;)
[13:45:41] <GothAlice> Define "break out". Split it into {serviceData: {seriesid: 1}}? No. That won't work.
[13:45:54] <[diecast]> yes, that's what i meant
[13:46:10] <[diecast]> ok, i'll learn about that more. thank you.
[13:46:32] <GothAlice> See alos: http://docs.mongodb.org/manual/core/document/#dot-notation
[13:46:37] <StephenLynx> diecast, if you are not familiar with JSON, learning it would help you greatly with mongo.
[13:47:33] <GothAlice> [diecast]: And again, for clarity, the difference here is between _defining_ data (which uses the {foo: {bar: …}} nesting approach, and _accessing_ it (which uses dot notation).
[13:47:54] <[diecast]> ok, i did get that from your texts
[13:48:08] <[diecast]> thanks again
[13:48:09] <GothAlice> ^_^ Had to make sure.
[14:02:12] <StephenLynx> hey, does anyone know these guys? http://www.online.net/en/dedicated-server/dedibox-scg2
[14:02:46] <GothAlice> … the picture of the server has the caption: * contractual picture
[14:02:51] <GothAlice> WTF does that even mean? XD
[14:03:40] <GothAlice> For your needs, i.e. lots-o-space, that box looks sufficient. It's single-core, so, that's a tad lame, but it certainly is cheap.
[14:04:28] <GothAlice> Also not sure what "victim of its success" means as an "availability" status. Does that mean they're out of them? … but it's green. Very confusing.
[14:04:55] <medmr> victim of its success probably means
[14:05:03] <medmr> there is a good chance of delays
[14:05:10] <GothAlice> But it's green. T_T
[14:05:12] <medmr> but its generally available
[14:05:39] <medmr> maybe they dont feel like turning it red/green every other day
[14:05:44] <medmr> and just want people to put orders in
[14:05:46] <GothAlice> So yeah, this company loses marks for clarity, but at that price the risk is pretty low.
[14:06:09] <GothAlice> medmr: If that's a manual process, I wouldn't do business with them. ;)
[14:07:22] <medmr> fair
[14:08:06] <medmr> i didnt mean out of laziness so much as, it could deter people if the see red and dont realize its switching very frequently
[14:08:13] <medmr> hence green but with a warning
[14:10:14] <medmr> *they
[14:32:09] <NoOutlet> It seems that I can't join until I've identified with NickServ now. Is that intended?
[14:32:34] <Number6> Yes, due to trolls I'm afraid
[14:33:05] <bspkrs> racist!
[14:33:12] <bspkrs> ;p
[14:34:24] <cheeser> he meant, Underbridge Dwellers. no insult was intended for our less than aromatic brethren.
[14:34:31] <Derick> huh? You should be able to join, but not say a word.
[14:34:54] <cheeser> Derick: looks like maybe joannac set +r
[14:34:59] <NoOutlet> #mongodb :Cannot join channel (+r) - you need to be identified with services
[14:35:03] <Derick> gah
[14:35:07] <Derick> not cool.
[14:35:23] <NoOutlet> My IRC client joins channels before automatically identifying so now I can't auto-join mongodb.
[14:35:36] <Derick> NoOutlet: which client is that?
[14:35:41] <NoOutlet> XChat.
[14:35:44] <greyTEO> has anyone encouted a problem when updating to wiredTiger on 3.0? I cannot see to create databases anymore.
[14:36:20] <NoOutlet> I have not looked into configuring it to prioritize identifying to be fair.
[14:38:11] <Derick> cheeser: not sure whether I like the +r...
[14:38:11] <StephenLynx> ooh, so that is what happened.
[14:38:30] <StephenLynx> joannac can you change it back? not being able to auto-join is annoying
[14:38:39] <NoOutlet> Looks like there is a fix for freenode! http://askubuntu.com/questions/6332/prevent-xchat-from-trying-to-join-channels-until-i-have-been-authenticated
[14:38:53] <Derick> good good
[14:39:42] <Derick> cheeser: I've forwarded her the thread when we had the trolls
[14:41:22] <NoOutlet> Seems like it worked.
[14:43:20] <NoOutlet> Sorry for the quit-join spam.
[14:45:33] <cheeser> Derick: i like the +r. it cut down a lot of that kind of thing in ##java when we did it years back.
[14:48:22] <StephenLynx> does it helps in anything that not being able to talk didn't helped already?
[14:49:27] <cheeser> it's more obvious that there's another step needed.
[14:49:42] <cheeser> a simple message to register can get lost in the chat for a busy channel
[14:57:44] <greyTEO> I believe the issue is with the gui I am using. Robomongo does not support wiredtiger
[14:59:25] <cheeser> not sure why it'd matter to robomongo
[15:01:02] <GothAlice> greyTEO: Robomongo has issues, but 3.0 troubles mostly surround it not supporting 3.0 authentication.
[15:01:12] <GothAlice> Also… some really weird index-related stuff earlier in the week.
[15:02:52] <greyTEO> GothAlice, I just found the git issues and it seems that is a big one.
[15:03:10] <greyTEO> I have just switched back to the default engine for now.
[15:04:14] <greyTEO> MongoChef seems to support the new auth and engine. Other option is shell
[15:04:22] <GothAlice> Shell superior to all.
[15:04:39] <GothAlice> Robomongo isn't much better than an interactive shell, anyway, and IMHO hides information from you in a very inconvenient way (collapsed tree entries shown as "{…}"; basically requiring slow mouse interacton) by default.
[15:05:22] <GothAlice> It's an anti-tool that adds to the effort needed, it doesn't reduce it. ;)
[15:09:19] <greyTEO> I use it mainly for quick glances. Shell can be a pain with a limited viewport. I do agree that is can slow things down at times though
[15:46:03] <Mxx> can any1 help me with adding existing server to mms?
[15:46:30] <Mxx> I get an error "Unexpected Error: Another session or user has already published changes"
[15:50:19] <cheeser> do you have multiple tabs open?
[15:55:57] <Mxx> i did not when I got that message
[15:56:18] <Mxx> but when I opened 2nd tab I saw there were 2 pending tasks to isntall monitoring and backup agents
[16:02:30] <Mxx> hmm now I added monitoring agent but it's stuck on "Verifying Host..."
[16:03:11] <Stiffler> hi
[16:04:07] <Stiffler> I have document. It already exists, and it contains couple of infos. But now I would like to add new Array field and push there values
[16:04:27] <Stiffler> http://pastebin.com/Hn7WKiDG
[16:04:30] <Stiffler> I have tried this
[16:04:44] <Stiffler> but it doesnt work
[16:05:08] <Stiffler> it doesnt save anything
[16:11:49] <GothAlice> He quit just as I finished reading "anything" and was about to click the link.
[16:11:52] <GothAlice> Patience, people. T_T
[16:16:36] <Derick> patience is a virtue
[16:18:53] <GothAlice> Ahahahaha. MMS has a repeal problem with allowing my browser to populate password fields automaticall.
[16:18:56] <GothAlice> Automatically, even.
[16:19:06] <GothAlice> I tried to add a role to one user, accidentally reset their password.
[16:19:54] <GothAlice> The power of autocomplete isn't with me today. Ugh. ^_^ *real, not "repeal"*
[16:41:29] <GothAlice> Wewt! My analytics reprocessing benchmark didn't bring MognoDB to its knees this time. \o/ http://s.webcore.io/image/1q023q1a0B2g — 4 processes, ~1K queries/second, ~250 updates/second, 3MB/s max throughput, zero page faults, zero index misses. So happy. :3
[16:41:59] <GothAlice> s/MognoDB/MongoDB/ I need to adjust this standing desk. :/
[16:43:06] <StephenLynx> what hardware you ran it?
[16:44:48] <GothAlice> StephenLynx: App server running the benchmark/migration is a Rackspace 4GB Performance VM, the DB hosts are 3 1GB General Purpose v1 VMs. Testing a lower memory allocation was also part of it, and why MongoDB exploded for me whenever I tried out WiredTiger. ;)
[16:46:18] <GothAlice> So, this reprocessed a total of 178,517 documents in ~4 minutes.
[17:02:28] <rendar> GothAlice: reprocessed = ?
[17:04:06] <GothAlice> rendar: The bulk of those documents are full records of request/response cycles. We mine this general purpose "activity" data for explicit click actions, then pre-aggregate the result into hourly segments. Normally this is done live, i.e. a new activity record comes in, it's also pre-aggregated into the hourly segment, but all of that data can be rebuilt from the source material.
[17:04:10] <GothAlice> We have a migration that does this if it finds the pre-aggregated data to be missing. Makes for a great benchmark. :)
[17:07:10] <ttaranto> hi! one tip, you could put all mongodb videos at your youtube channel, so we can watch then on smartv, I can't do it with this video: http://www.mongodb.com/presentations/webinar-fast-querying-indexing-strategies-optimize-performance
[17:09:17] <cheeser> ttaranto: you should send an email via that "contact us" link. get that request in the pipeline.
[17:09:18] <GothAlice> ttaranto: More things need to support HTML5 video. If this is helpful at all, http://cdnbakmi.kaltura.com/p/1067742/sp/106774200/serveFlavor/entryId/1_hkq7osow/v/1/flavorId/1_s8lv3c19/forceproxy/true/name/a.mp4 is the "video source" for that one.
[17:09:34] <cheeser> the people that deal with that stuff don't hang out here.
[17:09:42] <GothAlice> But yeah, YouTube is certainly "highly accessible" across devices.
[17:12:48] <GothAlice> latestbot: Could you fix your internets, please? ;) Your connection has been up and down like nobody's business.
[17:14:18] <ttaranto> thanks cheeser
[17:14:36] <latestbot> GothAlice: lol I guess I am going into sleep mode a lot :p
[17:14:58] <GothAlice> latestbot: Yeah, well, I was about to give you a temp ban to stop the noisy in-channel flapping. ;)
[17:15:32] <latestbot> Don’t do that please :(
[17:15:52] <GothAlice> latestbot: Might I interest you in: http://wiki.znc.in/ZNC
[17:16:07] <GothAlice> This is the "IRC bouncer" I use to maintain a persistent connection state, including when I migrate between devices.
[17:16:48] <GothAlice> (Basically, ZNC connects to Freenode for you, your IRC clients then are configured to connect to ZNC as the IRC server.)
[17:17:19] <latestbot> I used to use IRCCloud
[17:17:56] <latestbot> though configuring ZNC is a such a pain, I will look into it again
[17:18:26] <GothAlice> :/ It took five minutes. The rest of the hours I spent on it were poking around the many plugins. ;)
[17:19:00] <GothAlice> (I also like ZNC > IRCCloud because it's IRC client agnostic. Textual 5 looks infinitely better than the IRCCloud clients.)
[17:19:38] <GothAlice> (Also free.)
[17:19:51] <latestbot> I will surely look into it again
[17:26:20] <GothAlice> latestbot: https://gist.github.com/amcgregor/d6518eef1eb2071d12ab is my (redacted) znc.conf, but it includes a "znc --makeconf" tool, too. (If you use mine as a template, search for NOPE and use the "znc --makepass" command to generate new hashes.)
[17:26:29] <GothAlice> For whenever you get a chance to look into it. :)
[17:26:57] <latestbot> That’s so nice of you! thanks GothAlice!
[17:27:06] <GothAlice> It never hurts to help.
[17:46:24] <unholycrab> i have an easy question. how can i search the oplog for collection drops ?
[17:47:24] <cheeser> it amuses how often some labels something as easy when they're having to resort to asking for help with it.
[17:47:35] <GothAlice> XP
[17:48:02] <GothAlice> unholycrab: I'm a fan of https://github.com/cayasso/mongo-oplog which makes watching the oplog for events quite easy.
[17:48:36] <GothAlice> (In the case of dropping collections, those would be one type of "op".)
[17:48:43] <unholycrab> db.oplog.rs.find({"o": { "drop": { $exists: 1 } } })
[17:49:45] <cheeser> GothAlice: i've been debating writing a java lib to do that...
[17:50:30] <GothAlice> … unless one has extremely specific requirements and sporadic interactions with the oplog it's universally better to stream the bits you care about the same way MongoDB does, using a tailing cursor. (You can still filter to only the operations you care about, of course, but you get "live" notifications of newly added operations and it never needs to search through older data.)
[17:50:48] <GothAlice> cheeser: Don't do it, man! Java, woah. XP
[17:51:16] <cheeser> i've spent the last 20 years with it. not likely to stop now. especially for *javascript*
[17:51:44] <GothAlice> The type dynamism of MongoDB and the… exact opposite of that in Java always made me scratch my head. Doesn't seem like a good fit, or at least, if one is to make it fit there'll be a fair amount of boilerplate.
[17:52:12] <unholycrab> GothAlice: this is pretty cool. im looking for something that happened a few hours ago, though
[17:52:19] <cheeser> it's a great fit really. our most popular application platform is java.
[17:52:23] <cheeser> followed by javascript.
[17:52:46] <unholycrab> i think my query should be okay
[17:53:24] <GothAlice> unholycrab: Given an oplog record like this: https://gist.github.com/amcgregor/10f0cd5b1270e6a62584
[17:53:36] <unholycrab> yeah
[17:53:39] <GothAlice> Yeah, your query should be good. (Not efficient, but it should work. ;)
[17:57:29] <unholycrab> GothAlice: is an oplog record for a collection drop going to look like that every time?
[18:04:52] <GothAlice> unholycrab: Should, I believe.
[18:05:07] <GothAlice> Not sure if WiredTiger effects that structure as it does for dbStats.
[18:08:26] <cheeser> let's see!
[18:09:30] <cheeser> looks the sameish.
[18:09:54] <cheeser> i can't imagine that storage semantics would work their way given that hetergeneous clusters are a thing.
[18:46:58] <d4rklit3> hi
[18:47:23] <d4rklit3> is there a command for mongo 2.6.x to just remake all the database folder stuff
[18:47:25] <scellow> Hey guys, what does gt mean ? i Can't find it in the doc, cursor = collection.find(gt("i", 50)).iterator();
[18:47:31] <d4rklit3> liek i want to just delete the dbpath folder and remake it from scratch on this install
[18:47:44] <StephenLynx> $gt means "greater than"
[18:47:54] <StephenLynx> $gte also includes equal values
[18:48:02] <GothAlice> scellow: In whatever driver or ODM you are using, that likely constructs a $gt operator. I.e. {"i": {"$gt": 50}}
[18:48:07] <StephenLynx> you are missing a couple if {} there
[18:48:14] <GothAlice> StephenLynx: Or using a different API.
[18:48:22] <StephenLynx> yeah
[18:48:31] <StephenLynx> didnt took that into account
[18:48:37] <scellow> Ohh i see, i was just reading the official Getting Started with Java Driver from the website
[18:48:40] <scellow> thanks
[18:49:08] <d4rklit3> ?
[18:49:38] <GothAlice> d4rklit3: Simply running MongoDB with an empty data directory will be sufficient for your needs.
[18:49:45] <d4rklit3> weird
[18:49:51] <d4rklit3> i did that, now it saying it can't connect
[18:49:54] <GothAlice> (It'll recreate what it needs on startup, and when you first create a collection in a DB.)
[18:49:55] <d4rklit3> to the localhost...
[18:50:02] <GothAlice> d4rklit3: ps aux | grep mongod
[18:50:05] <GothAlice> Is it actually running?
[18:50:17] <d4rklit3> yeah
[18:50:25] <d4rklit3> 2046 0.0 0.0 10468 2136 pts/0 S+ 14:49 0:00 grep --color=auto mongod
[18:50:29] <GothAlice> That's not mongod.
[18:50:35] <GothAlice> That's the grep command _looking_ for mongod.
[18:50:36] <d4rklit3> err hold on
[18:50:59] <d4rklit3> mongod is running in the services
[18:51:07] <GothAlice> Unless the process exists, it's not running.
[18:51:44] <GothAlice> (I'm assuming, for the moment, that you are working on the DB host at the moment.)
[18:51:49] <d4rklit3> yeah
[18:51:56] <d4rklit3> in the shell on the ubuntu server
[18:52:03] <d4rklit3> i renamed the db folder
[18:52:05] <d4rklit3> and let it make a new one
[18:52:09] <d4rklit3> now it wont run
[18:52:17] <GothAlice> Ah, the "top level" folder does need to exist.
[18:52:34] <d4rklit3> it does..
[18:52:35] <d4rklit3> weird
[18:53:43] <d4rklit3> permissions
[18:53:44] <GothAlice> For example, /var/lib/mongodb. Only the _contents_ of the folder get recreated. Also, check permissions. Make sure whatever mongod wants to run as has permissions there. Also, check the logs. MongoDB is pretty good about giving error messages in the event of a problem.
[18:53:47] <GothAlice> :P
[18:55:01] <d4rklit3> mongodb was not owner
[18:57:07] <d4rklit3> yayay!
[19:19:51] <abishek> how to frame this query for mongo `select count(id), SUM(profit) FROM campaigns WHERE created_at BETWEEN (x,y)`
[19:20:09] <cheeser> you'd use an aggregation
[19:21:36] <abishek> cheeser, could you give me an example, am just new to mongo
[19:21:51] <cheeser> http://docs.mongodb.org/manual/aggregation/
[19:23:42] <GothAlice> abishek: See also: http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/
[19:24:34] <phutchins> Hey, if I point an app at a the master in a replica set, will it still be able to read from slaves? or only to that master ?
[19:25:35] <cheeser> phutchins: the drivers take that server (list) you give as a seed. they'll discover the topology and talk to the primary unless you use a read preference to force (or simply allow) a secondary read.
[19:25:53] <GothAlice> phutchins: Each server knows of the others, which is pretty useful.
[19:25:59] <phutchins> Basically i'm having a problem where doing an rs.remove on a node in our replica set crashed our app until it was restarted. I'm fairly certain that this was an issue with the connectionTimeout setting on the driver in nodejs which I've fixed but want to be cautious when testing the fix...
[19:26:17] <phutchins> cheeser: yep, so i should be able to give it a single master and it will still discover
[19:26:49] <phutchins> GothAlice: yeah definitely. I'm trying to point one of our workers directly at the master to avoid the issue i mentioned again if it happens...
[19:27:03] <cheeser> yes. though you should use a larger set as a ward against that machine being unreachable for whatever reason.
[19:27:13] <phutchins> GothAlice: but I think that the same thing may result since it still is just a seed node and gets the config
[19:27:37] <phutchins> cheeser: right, this would just be temporary while testing the fix. Not sure if there is any benefit tho
[19:28:10] <phutchins> so if i pointed at the master, and not the config server, it would still need to reconnect as the rs has changed, correct?
[19:29:03] <phutchins> that make sense?
[19:31:03] <cheeser> why would you point it at the config server?
[19:32:16] <phutchins> cheeser: well it is that way now. The last time we ran rs.remove, we had to restart all of our workers to get the app going again. The mongo driver in nodejs shouldnt' have a problem hadning this however. I updated the config to increase the connection timeout which should solve it but i'm trying to think up a fallback so that we can try the change again (rs.remove) but if it does the same thing as last
[19:32:22] <phutchins> time, wondering how I can make one of the workers not fail
[19:33:07] <phutchins> cheeser: maybe i meant mongos
[19:34:28] <cheeser> probably
[19:34:37] <girb1> is there a way in mongos router where in I can say all read queries should go to secondary in sharded cluster ?
[19:35:01] <girb1> I know we can mention it in mongo client
[19:35:13] <phutchins> cheeser: i attempted to duplicate the issue but was unable to in our staging envirohment which is why I think it has somethign to do either with load on the mongos or the cluster itself such that it slows down reconfigure time
[19:36:28] <phutchins> cheeser: so the way i understand it, there probalby is no good way to work around this with a single worker. If its going to happen again, its going to happen...
[19:43:20] <d4rklit3> hrmm
[19:43:34] <d4rklit3> assertion: 13 not authorized on admin to execute command when trying to run mongorestore
[19:43:41] <Bookwormser> Can someone explain what is wrong with this query? I am trying to count all between 2 unix timestamp ranges, but I get no results. There are records with these timestamps though: db.mycollection.count({'m_time' : {'$gte' : '1426550400', '$lt' : '1426636800'}})
[19:43:55] <Bookwormser> I get back 0 each time.
[19:45:37] <GothAlice> Those are strings, mate.
[19:47:40] <GothAlice> Bookwormser: Double check your actual stored data. Make sure those are being stored as numbers (4 bytes) instead of strings (4+10+1=15 bytes), then update your query to query them as numbers.
[19:51:11] <FlynnTheAvatar> Hi, are there already Centos7 RPMs for mongo 2.6.9?
[19:51:46] <GothAlice> FlynnTheAvatar: Have you tried: http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-red-hat/
[19:52:45] <FlynnTheAvatar> GothAlice: Yes, I tried it. But it seems 2.6.9 rpms are missing at http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/RPMS/
[19:53:42] <GothAlice> Well then. :D FlynnTheAvatar: Could you open a ticket on http://jira.mongodb.org for this?
[19:57:11] <GothAlice> FlynnTheAvatar: http://downloads.mongodb.org/linux/mongodb-linux-x86_64-rhel70-2.6.9.tgz (via http://www.mongodb.org/dl/linux/x86_64) may be sufficient to get you going.
[19:57:30] <FlynnTheAvatar> GothAlice: Sure. In project Core Server?
[19:57:52] <GothAlice> Yup.
[19:59:14] <FlynnTheAvatar> GothAlice: We have working Dockerfiles that install MongoDB with yum...
[20:03:11] <vipul20> there's a log file in mongodb but no config file found in /etc/init.d and checking on port 27017 displays no result
[20:03:39] <FlynnTheAvatar> GothAlice: We created the issue (SERVER-17738)
[20:03:45] <GothAlice> vipul20: Log files don't go in the initialization script folder. /etc/mongod.conf exists?
[20:03:50] <vipul20> but I am running a project by which I can make operations in mongodb
[20:04:29] <vipul20> GothAlice: no /etc/mongod.conf doesn't exists
[20:05:06] <GothAlice> vipul20: sudo lsof | grep mongod | grep LISTEN — this will tell you what IP and port mongod is listening on; if nothing's there, mongod might not be running: ps aux | grep mongod
[20:05:52] <GothAlice> vipul20: Finally, to see what the command line of the running mongod process was, run: sudo cat /proc/`pidof mongod`/cmdline
[20:06:05] <GothAlice> (MongoDB doesn't use a configuration file unless explicitly told to on the command line.)
[20:07:46] <GothAlice> (The command line might look a bit garbled, like there are no spaces between options, when printed out this way. That's OK and normal.)
[20:08:11] <vipul20> GothAlice: ps aux is giving me the pid
[20:08:35] <vipul20> GothAlice: but the lsof command is not giving me any information
[20:08:39] <GothAlice> The "ps" + grep command here should emit two lines.
[20:08:41] <GothAlice> Not one.
[20:09:01] <GothAlice> (If the line includes the word 'grep', you're finding the process that's searching the processes for mongod. ;)
[20:09:45] <vipul20> GothAlice: output of ps aux(whole command) is " 8339 pts/16 S+ 0:00 grep --color=auto 27017"
[20:09:52] <GothAlice> Yup, mongod isn't running.
[20:10:28] <vipul20> there is no /etc/init.d/mongod either
[20:10:35] <GothAlice> How did you install it?
[20:10:37] <GothAlice> Also, distro?
[20:11:48] <GothAlice> FlynnTheAvatar: Also, thanks. I'm not sure if anyone with the ability to correct the missing RPM camps in this channel or not, so a JIRA ticket is the way to go to make sure it sees some action. :)
[20:13:06] <cheeser> GothAlice: reasonably sure that answer's no
[20:13:23] <GothAlice> cheeser: Heh, yeah.
[20:13:56] <vipul20> GothAlice: this is the error i got on running mongod by /etc/init.d/mongod start
[20:13:58] <vipul20> http://pastebin.com/tDYFBXh0
[20:15:10] <FlynnTheAvatar> GothAlice: Yeah, sure. I just wanted to check if somebody was already working on it.
[20:15:18] <GothAlice> vipul20: Some notes: a) it's binding to 127.0.0.1 only, meaning only local access is allowed. (Generally a good thing. ;) b) It's trying to use /etc/mongodb.conf for configuration. c) It looks like you have some stuck data, there. Did the server crash or was it otherwise abruptly restarted in the recent past?
[20:16:11] <GothAlice> vipul20: Specifically, it's reporting damage to files in /var/lib/mongodb/ (the journal). You may need to manually run mongod (with the same options as the init.d script tries to), but with the addition of --repair.
[20:16:32] <GothAlice> (To repair, though, you'll want 2.1x as much free space as the size of your data.)
[20:19:05] <vipul20> GothAlice: please can you tell me the exact command?
[20:19:58] <GothAlice> First, does /etc/mongodb.conf exist? ('db', not just 'd' at the end there)
[20:21:01] <vipul20> GothAlice: yes it does
[20:21:23] <GothAlice> Cool, could you gist/pastebin it? That'll confirm what I need to put on the command line.
[20:21:48] <GothAlice> Oh, and who owns /var/lib/mongodb? (ls -l /var/lib)
[20:23:29] <vipul20> http://pastebin.com/Ua1Wf1jC
[20:23:50] <vipul20> mongodb owns the /var/lib/mongodb
[20:24:11] <GothAlice> sudo -u mongodb mongod --config /etc/mongodb.conf --dbpath /var/lib/mongodb --repair
[20:24:30] <GothAlice> :)
[20:25:09] <vipul20> it is giving me this output "Thu Mar 26 01:54:10.689 Can't specify both --journal and --repair options"
[20:25:10] <GothAlice> (Luckily you had no options set in the config that I would have had to disable.) Didn't technically need to include the dbpath a second time, but I had already written it out just in case. ;)
[20:25:15] <GothAlice> Aaah, okay.
[20:25:51] <vipul20> GothAlice: what should i do next?
[20:26:37] <GothAlice> You're running a rather ancient version of MongoDB, it seems. 2.4? In this instance, we can't repair the journal. Instead, the only option left is to remove the dead journal files and let MongoDB recreate it, losing whatever may have been stuck there.
[20:27:47] <GothAlice> vipul20: sudo rm -rf /var/lib/mongodb/journal; sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair
[20:28:37] <GothAlice> Step one there removes the bad journal. Step two attempts a standard repair (without configuration and journalling option)—if your journal was corrupt, there may be other issues, though hopefully not. This effectively exports and re-imports your data in a safe way. Then, you can try to start up the server as normal.
[20:31:34] <vipul20> GothAlice: thanks that worked :D
[20:31:53] <GothAlice> Heh; triple check that your data looks OK.
[20:32:13] <GothAlice> Corrupt journal = bad news bears, and can be a sign of broader issues like disk failure.
[20:36:24] <FlynnTheAvatar> GothAlice: That was quick, the RPMs are now available
[20:36:30] <GothAlice> :)
[20:37:05] <GothAlice> Glad to hear it. I tried voting for your issue, but you submitted it privately and I couldn't see it. ;)
[20:37:14] <GothAlice> Silly security.
[20:41:00] <FlynnTheAvatar> Well, I created it in SERVER, but it was moved to CS because we have commercial support
[20:41:29] <GothAlice> FlynnTheAvatar: Then what are you doing asking in here? Commercial support rocks! :D
[20:41:47] <GothAlice> are/were
[20:42:21] <NoOutlet> Yeah, why drink the free milk when you already bought the cow?
[20:43:02] <GothAlice> Interesting analogy…
[20:44:21] <FlynnTheAvatar> well, personally I thought it was a slight oversight and not important enough for commercial support. the RPMs are the community version anyways
[20:45:17] <ehershey> sorry about that!
[20:45:24] <ehershey> I was working on it already actually after seeing it in here
[20:45:40] <ehershey> then chased the server ticket and cs ticket
[20:47:02] <GothAlice> ^_^
[20:47:04] <FlynnTheAvatar> ehershey: no problem - thanks again for taking care of it.
[20:47:38] <GothAlice> One of the pleasant cases where someone capable of fixing it _was_ present on IRC. XD
[20:58:03] <ehershey> I love to see problems I can fix on irc
[21:12:20] <d4rklit3> hey I am authed with my admin db
[21:12:28] <d4rklit3> when i use another db and try to drop it or auth with it
[21:12:33] <d4rklit3> it doesn twork
[21:13:54] <d4rklit3> i have no access to this databse
[21:15:19] <GothAlice> d4rklit3: MongoDB users are per-database. If your admin user is registered against the admin database, you'll need to remember to set your --authenticationDatabase when using command-line tools against other DBs.
[21:15:34] <d4rklit3> is there a link on how to do this
[21:15:50] <GothAlice> … --authenticationDatabase
[21:15:59] <d4rklit3> inside of mongo?
[21:16:03] <GothAlice> Thus: mongo --authenticationDatabase admin -u admin -p … someotherdb
[21:16:07] <GothAlice> Or mongodump --authenticationDatabase …
[21:18:13] <d4rklit3> that doesn't work
[21:18:20] <d4rklit3> or wait
[21:18:55] <d4rklit3> nope
[21:18:56] <d4rklit3> doesn't work
[21:19:07] <d4rklit3> "not authorized on cf-db to execute command { dropDatabase: 1.0 }",
[21:19:28] <d4rklit3> mongo --authenticationDatabase admin -u cedar-fair-db-admin -p thepassword cf-db
[21:20:01] <GothAlice> :/ Doesn't look like you gave your admin user the right permissions.
[21:20:16] <d4rklit3> roles:[{role:"userAdminAnyDatabase",db:"admin"}]}
[21:20:17] <d4rklit3> ?
[21:20:29] <d4rklit3> that would explain a lot
[21:20:36] <nemothekid> How do I find - where the value is ONLY the value and NOT inside the array?
[21:20:38] <d4rklit3> iirc this is what the docs say
[21:20:43] <GothAlice> That role lets you manage the users. (But not do other things.)
[21:20:43] <GothAlice> http://docs.mongodb.org/manual/tutorial/add-admin-user/
[21:20:52] <nemothekid> ex. {"a":"b"} should not return {"a":["a", "b"]}
[21:21:04] <d4rklit3> durr
[21:21:06] <GothAlice> d4rklit3: The docs say roles: ['root'] for the first admin.
[21:21:40] <GothAlice> nemothekid: The rare time using $eq might help.
[21:21:58] <GothAlice> nemothekid: Ref: http://docs.mongodb.org/manual/reference/operator/query/eq/
[21:22:10] <nemothekid> GothAlice: {"eq":null} seems to have the same effect (trying to find null fields)
[21:22:27] <GothAlice> Ref: http://docs.mongodb.org/manual/reference/bson-types/#bson-types-comparison-order
[21:22:57] <GothAlice> The $ is important, BTW.
[21:23:05] <wutze> Hi there has the noew mongodb-java-api-3.0 a getDocument() and getArray() functions? With the old driver there was only a get() and i had always to cast my values
[21:23:10] <GothAlice> {field: {operator: value}} — "$eq" is an operator.
[21:23:26] <nemothekid> yeah I have the equal, the count is the same as if I don't have the eq
[21:23:59] <GothAlice> nemothekid: Until you gist/pastebin the actual query you're running… {"eq" null} is what you wrote, and it's wrong.
[21:24:29] <nemothekid> GothAlice: http://pastie.org/10053573
[21:24:34] <nickmbailey> kk
[21:24:37] <nemothekid> "eq" null was a typo
[21:24:42] <nemothekid> not the query I'm running
[21:24:52] <GothAlice> nemothekid: Hmm, looks like it's still running into the BSON comparison order. :/
[21:25:12] <GothAlice> $type semi-works, but arrays interact somewhat strangely with it, too.
[21:26:07] <GothAlice> Further confirmation that mixing types in a single field name = bad mojo. You may have to manually sift through the records returned, rejecting ones for which that field is an array application-side. (Pro tip: fix the data.)
[21:26:30] <nemothekid> yeah I'm trying - a bug created these null fields
[21:27:01] <GothAlice> Hmm.
[21:27:12] <nemothekid> $type: 10 (array) returns 0, but type 4 (null) returns everything
[21:27:26] <nemothekid> manual might the only option
[21:28:18] <d4rklit3> GothAlice, ok so root access... Error creating index cf-develop.system.users: 13 err: "not authorized to create index on cf-develop.system.users"
[21:28:24] <GothAlice> You can complicate the query a bit… {assets: {$eq: null, $not: {$elemMatch: {$eq: null}}}}
[21:28:39] <d4rklit3> useing all the commands
[21:28:48] <d4rklit3> -u -p --authenticationDatabase admin etc
[21:28:49] <GothAlice> nemothekid: This will select documents whose "assets" field is null, or an array containing null, then exclude the ones that have array elements that are null. ^_^
[21:29:13] <nemothekid> GothAlice: that worked
[21:29:14] <nemothekid> thanks
[21:29:16] <GothAlice> :D
[21:30:16] <GothAlice> I'm kinda creeped out by that query. ^_^ Super hack, much horror.
[21:34:02] <GothAlice> d4rklit3: You have a hyphen in your collection name?
[21:34:09] <GothAlice> For serious?
[21:34:19] <d4rklit3> i do where?
[21:34:33] <d4rklit3> cf-develop is the db name
[21:34:37] <GothAlice> :|
[21:36:17] <GothAlice> The amount of success you have, doing anything, will be highly variable because of that. "cf-develop" isn't a valid symbol name in any sane language (being interpreted as "cf minus develop"). One should keep their database and collection and field names within the realm of the following regular expression: [_a-zA-Z][_a-zA-Z0-9]*
[21:36:28] <d4rklit3> well shit
[21:36:31] <d4rklit3> compose.io
[21:36:32] <d4rklit3> let me do it
[21:36:34] <d4rklit3> didn't complain
[21:36:46] <GothAlice> MongoDB lets people do many things they probably shouldn't. It's very… flexible… that way. ^_^
[21:36:52] <d4rklit3> ok noted
[21:36:55] <d4rklit3> i'll rename
[21:36:59] <GothAlice> Twice now I've assisted users who had a collection named "[object Object]".
[21:37:00] <GothAlice> ^_^
[21:37:09] <d4rklit3> ok im not that bad
[21:37:17] <GothAlice> Well, both cases were accidental.
[21:37:37] <d4rklit3> underscore is ok?
[21:37:41] <GothAlice> Sure is.
[21:37:52] <GothAlice> Dots are _right out_.
[21:38:24] <GothAlice> (Some system collections use dots. Generally advisable to not use them in your own collection names.)
[21:39:21] <d4rklit3> i dont use dots
[21:39:25] <d4rklit3> noids me out
[21:39:53] <GothAlice> However, you should use your admin user to create a database-local user with sufficient permissions to backup/restore and use the DB. I.e. readWrite@<dbname> and/or dbAdmin@<dbname>
[21:40:05] <GothAlice> Then you can also avoid the --authenticationDatabase thing.
[21:40:06] <d4rklit3> usernames
[21:40:09] <d4rklit3> can have hyphens right
[21:40:11] <d4rklit3> they are just tsrings
[21:40:27] <GothAlice> … they're just strings, but again, it's wise to stick to a sane regex that excludes most symbols.
[21:40:45] <GothAlice> (There's _never_ a real need to use symbols in usernames.)
[21:42:00] <GothAlice> Passwords, being hashed, though, are completely symbol safe.
[21:44:41] <d4rklit3> GothAlice, what was that link with the user creation commands
[21:44:51] <d4rklit3> forgot the format for the createuser command with roles
[21:45:45] <d4rklit3> i found it nvm
[21:50:21] <d4rklit3> um.. what was the deal with robomongo.. never us it.. what is an alternative ui?
[21:50:53] <GothAlice> The… mongo shell? :3
[21:51:09] <d4rklit3> gui
[21:51:12] <GothAlice> ±mongoexport, which is pretty handy for quick queries.
[21:51:30] <d4rklit3> robomongo is telling me fuck off trying to manage users
[21:51:35] <d4rklit3> well its telling me nothing actually
[21:51:40] <d4rklit3> doesn't list the users
[21:51:44] <GothAlice> Yeah, RoboMongo doesn't work so well with 3.0 yet.
[21:52:13] <d4rklit3> I downgraded
[21:52:14] <d4rklit3> 2.6
[21:52:27] <GothAlice> Did you downgrade the auth schema?
[21:52:45] <d4rklit3> well. by I downgraded, i mean they did
[21:52:48] <d4rklit3> how do i check
[21:53:22] <GothAlice> Ref: http://docs.mongodb.org/manual/release-notes/3.0-downgrade/
[21:53:52] <d4rklit3> i dont care about the databases
[21:53:55] <d4rklit3> i already cleared them out
[21:53:58] <d4rklit3> and let it remake
[21:54:31] <GothAlice> http://docs.mongodb.org/manual/release-notes/3.0-downgrade/#downgrade-path < yeah, 'cause auth can't be downgraded. Okay, if you nuked it, I'm not sure what the issue is.
[21:54:44] <d4rklit3> ok
[21:54:48] <d4rklit3> i mean auth works fine
[21:54:50] <d4rklit3> i can connect
[21:57:05] <d4rklit3> now you're going to tell me... don't use chars liek ! or ? in your passwords?
[21:57:08] <d4rklit3> right?
[21:57:34] <GothAlice> Not at all.
[21:57:50] <d4rklit3> my mongo uri is being weird
[21:57:51] <GothAlice> Just be aware, if entering them in a shell, that they will require escaping or quoting.
[21:58:08] <d4rklit3> do i need to urlencode into a mongo uri string?
[21:58:26] <GothAlice> The "@" symbol in a password becomes somewhat problematical when using URI connection strings, too.
[21:58:32] <d4rklit3> there is no @
[21:58:34] <d4rklit3> just ! and ?
[21:59:01] <GothAlice> I'm not sure if they need to be encoded; it's one of those "try without, then try with if option A fails".
[21:59:40] <aliasc> Hi,
[22:01:59] <GothAlice> Hmm, now that I think about GUIs, there *is* an ncurses interface I use: bpython. (I use ipython most of the time, though.) "screen" + "bpython" + "pymongo" == robomongo in a terminal.
[22:02:00] <d4rklit3> lol if i urlencode auth fails!
[22:02:05] <d4rklit3> facepalm
[22:02:11] <GothAlice> Then clearly encoding is not needed.
[22:07:13] <GothAlice> http://showterm.io/3f3a1fe53c942ae622c63 < python example (darn showterm doesn't handle ANSI repositioning very well)
[22:07:26] <GothAlice> Rather, BPython MognoDB Shell example.
[22:07:58] <GothAlice> Mongo. Ugh. This is what happens when I have zero caffeine in a day.
[22:08:46] <d4rklit3> im on coffee #2
[22:11:53] <d4rklit3> the real issue is kidneys
[22:11:58] <d4rklit3> sleep deprivation .. meh
[22:13:18] <GothAlice> Well, anyone who Code Commanders for 4 days straight is in for a painful following day after filtering 4 days of accrued toxins.
[22:15:16] <d4rklit3> what is Code Commanders
[22:16:03] <GothAlice> "Code Commander" noun; one who exceeds expected code production rates by two or more orders of magnitude.
[22:16:52] <d4rklit3> what dictionary is that in
[22:16:54] <GothAlice> I was producing 2.5K source lines of code every 24 hours during last week's four days straight of no-sleep. ;)
[22:17:06] <d4rklit3> shit i don't want your job
[22:17:09] <GothAlice> XP
[22:20:17] <GothAlice> "Core Dump" – to relieve oneself while ill or under duress; often explosively. See also: "captain's log". "Offline maintenance" – to become unconscious, generally on a regular schedule.
[22:37:58] <d4rklit3> GothAlice is there an online source for these?
[22:38:19] <GothAlice> Nah, these are coming from my brain.
[23:02:34] <aliasc> just read a post
[23:02:41] <aliasc> why you should never use mongodb
[23:03:53] <aliasc> is mongodb good for social networking website ?
[23:04:55] <GothAlice> aliasc: https://blog.serverdensity.com/does-everyone-hate-mongodb/ and it can be great for general data storage on a social-style site. For storage of the actual social connectedness graph, though, use a real graph database. (Or write a graph back-end for MongoDB 3. ;)
[23:05:44] <GothAlice> There's a tool called mongo-connector which can greatly aid in having "data" in MongoDB and "graph" elsewhere.
[23:05:55] <aliasc> the post says, if you link documents with ids you are going against basic concepts of mongodb
[23:06:03] <aliasc> and relationships in a social networking website are a must
[23:06:22] <GothAlice> To an extent, yes. MongoDB isn't relational, so you can't perform efficient joins.
[23:06:44] <GothAlice> However, even most popular FOSS SQL systems can't handle deep graph searches. Graph databases are their own bucket of bolts.
[23:07:26] <aliasc> we are talking about simple blog lets say
[23:07:43] <GothAlice> Blogs don't need graphs, so MongoDB makes for a great solution.
[23:07:48] <GothAlice> Same with forums.
[23:08:00] <aliasc> i love mongodb you can alter your data the way you want
[23:08:06] <aliasc> no need for modeling schemas
[23:08:13] <GothAlice> Not entirely true.
[23:08:36] <GothAlice> Put two different types of values in the same field name in a collection and watch your queries crumble.
[23:08:43] <aliasc> well i also feel like if you follow the rules of relationships you are doing it wrong in mongodb
[23:08:50] <GothAlice> So, ensuring there aren't conflicts is somewhat like a "minimum effort schema".
[23:09:14] <GothAlice> A graph database is needed to answer queries like: find me all friends up to four connections away from user X who also have user Y in common.
[23:10:49] <aliasc> im running a software with mongodb in the backend for checking new videos and channels in youtube cms
[23:11:01] <aliasc> and updating attaching logos on thumbnails
[23:11:04] <aliasc> it performs very well
[23:11:06] <GothAlice> However, in the simple relational example of forums (forums::threads::replies, all one:many) turns into an almost-relational model in MongoDB: replies are embedded in threads which reference forums.
[23:12:05] <GothAlice> http://www.javaworld.com/article/2088406/enterprise-java/how-to-screw-up-your-mongodb-schema-design.html points out the important task: identifying what a "document" is, in your model, is key.
[23:13:06] <GothAlice> A reply to a thread… doesn't really deserve to be its own top-level document. It's fully dependant on the thread, should get cleaned up with the thread, etc. And MongoDB atomic operations and array manipulation ($push, $elemMatch, etc.) allow you to embed it naturally.
[23:13:22] <GothAlice> s/embed/manipulate/
[23:14:57] <aliasc> if it wasnt for the limit of documents embedding is an option however
[23:15:01] <aliasc> look what the post notes
[23:15:23] <aliasc> in a social website a user who liked the post may be embedded into the post
[23:15:30] <aliasc> that user might also be friend
[23:15:37] <aliasc> and that user might also be commenter
[23:16:10] <aliasc> embedding and duplicating data means moving through each one of them to modify on changes
[23:16:39] <GothAlice> https://github.com/bravecollective/forums/blob/develop/brave/forums/component/comment/controller.py#L110-L134 is my forum "voting" code (like giving it a thumb up)
[23:17:02] <GothAlice> Note, I'm not storing anything but the ID of the user who voted up, and incrementing a pre-aggregated sum.
[23:19:00] <aliasc> im new to mongodb i admit it. and there are times where i feel like im not cooperating with the concepts of mongodb
[23:19:19] <aliasc> instead im fighting between the balance of schemaless and er
[23:19:35] <GothAlice> It's not easy if you come from an existing database background. There is much to unlearn.
[23:19:50] <GothAlice> (Databases can be waaay cooler than a fancy spreadsheet.)
[23:20:06] <aliasc> true, i found mongodb useful for bulk operations, the software i wrote performs incredibly well
[23:20:12] <aliasc> it handles 40k+ videos daily
[23:20:38] <aliasc> not entirely sure for websites like blogs and social media
[23:20:47] <GothAlice> These forums, peak, had about 20K users, and several years worth of accumulated threads. ^_^
[23:20:59] <aliasc> not always
[23:21:46] <aliasc> a sweet thing is when not having to join from 10 tables
[23:22:16] <aliasc> however big companies still choose to work with rdmbs
[23:22:28] <GothAlice> Big companies use everything.
[23:22:38] <GothAlice> "The right tool for the job." and whatnot.
[23:22:59] <aliasc> exactly
[23:23:13] <aliasc> Diaspora a project on kicktarter was using mongodb, they felt betrayed
[23:23:18] <GothAlice> Heck, I'm a Python developer running her code in Java to abuse Java's excellent natural language processing and neural network libraries, storing most data in MongoDB and graphs in neo4J.
[23:24:06] <GothAlice> aliasc: Betrayed by what? Most big "MongoDB is crap" blog posts have no basis in reality and only serve to demonstrate that the author failed to read the documentation.
[23:24:36] <GothAlice> … or was clearly misusing the DB. I.e. to store graphs.
[23:24:43] <aliasc> true true, i dont always believe what a frustrated shitty developer wrote on his blog
[23:25:11] <GothAlice> Then there's TokuMX.
[23:25:15] <GothAlice> You think your database is fast now…
[23:25:18] <aliasc> honestly i try to avoid posts that say mongodb sucks but you need to face some
[23:26:11] <aliasc> im not saying if mongodb is professional database im trying ti figure it out if its the best choice for my project
[23:26:17] <GothAlice> (TokuMX is a fork of MongoDB… on LSD. It uses fractal trees for storage and change propagation, avoiding almost all forms of locking during operation.)
[23:27:01] <aliasc> never heard of TokumX
[23:27:05] <aliasc> can i try it
[23:27:08] <GothAlice> aliasc: Again, why make only one choice? (We use MongoDB for data, neo4J for graphs. If we _really_ needed transactional safety, say, for financial operations, I'd add postgres to the mix.)
[23:27:13] <GothAlice> There is a FOSS version, yes.
[23:27:59] <GothAlice> Oh, TokuMX also supports true transactions.
[23:28:00] <GothAlice> ¬_¬
[23:28:02] <GothAlice> It's neat.
[23:28:16] <aliasc> and then you need 10 employees to manage your data
[23:28:28] <GothAlice> Eh, my database hosts are self-configuring.
[23:28:34] <aliasc> of different types
[23:28:46] <GothAlice> Yup.
[23:28:59] <GothAlice> None of my databases use permanent storagae.
[23:29:23] <aliasc> why having limits to how long documents can be ?
[23:30:06] <GothAlice> I.e. the VM starts, tries to connect to the cluster. If it can't it pulls out of deep storage the latest snapshot and the oplogs between the snapshot and now, replays them, then spins up two more hosts automatically to use as replication secondaries. If an existing cluster is found, it pulls the latest snapshot, applies it, then joins the replica set and caches up from the live oplog.
[23:30:16] <GothAlice> aliasc: To limit the impact of worst-case scenarios.
[23:31:11] <aliasc> can you give me a ling of how you would model your data for a blog/portal website in mongodb
[23:31:14] <aliasc> link*
[23:31:51] <GothAlice> Pro tip: if writing a "blog" site, don't do comments yourself. (Use one of the hosted comment tools like Disqus; comment moderation is a PITA to write.)
[23:32:46] <GothAlice> If you don't need to deal with comments, then, a blog is what, {_id: …, slug: "your-code-style-guide-is-crap-but-still-better-than-nothing", title: "…", lead: "…", body: "…", modified: …} and that's about it.
[23:32:51] <aliasc> i was thinking about it,
[23:32:54] <aliasc> thanks for the link
[23:33:16] <aliasc> :D
[23:33:32] <aliasc> a post has a category or categories and a post has an author
[23:33:33] <GothAlice> (That's an actual title of one of my blog posts. ;)
[23:33:50] <aliasc> send me the links
[23:33:54] <GothAlice> Okay, {_id: …, …, category: […], author: ObjectId(…)}
[23:34:01] <GothAlice> There are no links because this is so simple. ;)
[23:34:06] <aliasc> oh, relationships :)
[23:34:08] <GothAlice> Copy and paste into Notepad, my friend. ;)
[23:34:49] <aliasc> i already modeled my data like this im trying to see if im doing it wrong :P
[23:34:51] <GothAlice> Yup. Since you might want to display the author name with the blog post (pretty typical) you might store this instead: {… author: {id: ObjectId(…), name: "Alice"}}
[23:35:07] <GothAlice> This will save an extra lookup for each post.
[23:35:27] <GothAlice> (If you ever change your name, just $set the new value across all matching posts.)
[23:36:24] <aliasc> this is what i was trying to discuss, so you need to set the new value across all matching posts
[23:36:27] <GothAlice> Also, in many blogs a "category" is basically just a simple string tag. Store the string tags in the posts, not ObjectId references to a collection of these tags. :)
[23:36:48] <aliasc> also in many blogs categories can appear in the main menu
[23:37:14] <aliasc> you cant put a category in a post as a string if you mean to categorize posts
[23:37:42] <GothAlice> You can use an aggregate query to get the set of all unique categories from the posts themselves, or even pre-aggregate it. (I.e. store the string version in the post, but _also_ insert it into a collection of categories, with the string as the _id. Then, generating the menu is one simple query.)
[23:37:52] <GothAlice> aliasc: Yes you can. The string is the unique key. :D
[23:38:27] <aliasc> like this you are not modeling you are fighting opening new doors for problems
[23:38:36] <GothAlice> {title: "How to screw up your MongoDB schema design", category: ["MongoDB", "Java"]}
[23:38:46] <GothAlice> db.posts.find({category: "Java"}) — bam.
[23:39:06] <aliasc> give me all categories so i can put them in the header menu
[23:39:07] <GothAlice> Then there are no database lookups to show the list of categories on each post. :)
[23:40:12] <GothAlice> db.posts.aggregate([{$unwind: "$category"}, {$group: {_id: '$category'}}]) — all categories ever mentioned, but only included in the list once, each.
[23:40:47] <aliasc> hundreds of thousands of posts to query for 10 categories
[23:41:05] <GothAlice> I mentioned pre-aggregation of the categories above.
[23:41:31] <aliasc> bare with me maybe i dont understand the full concept of mongodb. i said im new
[23:41:35] <GothAlice> When you add a post, attempt to insert each category into a "categories" collection. I.e. db.categories.insert({_id: "MongoDB"}) — if it blows up, it's already there.
[23:41:51] <GothAlice> (And yes, that's the sum total needed for a "category" document in this case.)
[23:42:19] <GothAlice> Then, getting the list of categories is: db.categories.find()
[23:43:06] <GothAlice> This isn't data duplication: it's query optimization. :D
[23:43:25] <aliasc> its hard to think this way when you come from other database background
[23:43:30] <aliasc> especially relational
[23:43:36] <GothAlice> (If you already have blog posts, the .aggregate query above can be used to populate the initial categories collection. :)
[23:43:52] <GothAlice> (Or rebuild it.)
[23:43:53] <aliasc> like what the heck is this good or bad approach
[23:44:10] <GothAlice> It's an approach. "Good" and "bad" require measurement.
[23:46:51] <GothAlice> Straight up relational, with ObjectId references to categories, would cripple read performance by requiring you to perform an extra query (potentially several depending on how well written your loops are) just to look up the category names. Same if you embed _only_ the ObjectId of the author. That'd make displaying one posting = 3 queries (optimized). Showing a paginated listing of them? Yeah… 1 query to get the initial list, 2 extra
[23:46:51] <GothAlice> queries for every row you display, if you stream the rows out.
[23:47:46] <GothAlice> (You can optimize this to only three queries total, too, if you pull in all the data before emitting anything out, but that's sub-optimal from a responsiveness perspective.)
[23:49:16] <GothAlice> Often it's beneficial to show _something_ quickly, even if it takes longer to fully load _everything_. :)
[23:50:57] <GothAlice> I hope all of this has been somewhat helpful to your understanding, and not just adding to the confusion.
[23:51:01] <GothAlice> aliasc: ^