[00:11:02] <Ciaro> I'm trying to tackle http://docs.mongodb.org/ecosystem/use-cases/category-hierarchy/, but I don't know much about Python, I have some questions about the example codes
[00:11:38] <Ciaro> In 'build_ancestors_full' => parent_id isn't that suppose to be parent?
[00:12:54] <Ciaro> If someone could provide me with some pseudo explanation on 'build_ancestors_full', would be much appreciated
[00:16:55] <joannac> Ciaro: Um, no? You pass in an _id and a new parent _id, and it rebuilds the ancestors list
[00:17:16] <joannac> although I don't know what line you're talking about
[00:23:47] <Ciaro> @jaonnac: I posted some more info on my question here: http://stackoverflow.com/questions/20601631/some-questions-on-mongodb-category-hierarchy-use-case
[00:33:26] <Ciaro> k ty, any idea about the second question?
[00:33:50] <joannac> you get an id and a parentid. if the parentid (A) is not null, find its entry, add A to your list of ancestors, find A's parent (B), repeat until you get to the top and there are no more parents
[00:33:53] <Ciaro> code doesn't make sense for me (if I understand it correctly)
[00:34:13] <Ciaro> sorry I typed before your explenation
[01:19:53] <schofld> hello:) ... i am learning how to build more complex apps and am wondering how i should manage users in the database. Take creating an 'event', inviting people (giving them access to view), letting some host (edit the event), not allowing other users to view. How should i manage this in the database?? Or a good handbook to recommend
[01:21:23] <jkitchen> schofld: well, in relational land you might have 3 tables there. users, events, and a join table which associates the users to the events (invites?)
[01:22:40] <jkitchen> and if you want multiple admins on the table you'd just have like an is admin flag on the join table, otherwise just have an "owner id" on the event table (or maybe both?)
[01:23:27] <jkitchen> multiple admins on the event that is
[01:23:40] <jkitchen> in mongo? dunno, but I imagine that could be translated fairly easily
[01:24:01] <jkitchen> I'm more from the administration side of mongo rather than the actual database design side though.
[01:24:49] <schofld> jkitchen: (thanks for answering) Ok... What is this called the 'database structure?'
[01:27:39] <jkitchen> so, depending on which part you want to maintain, you can have the event know about the users, or the user know about the events, or both.
[01:27:55] <jkitchen> both have their upsides and downsides
[01:28:10] <jkitchen> but in RDBMS both cases are covered equally well by the join table, so...
[01:28:14] <schofld> what i am basically trying to figure out is how to design my database.... Yes that's the problem there are a fewe different ways i can imagine doing this. I just feel ther eis a convention or general design pattern
[01:28:35] <jkitchen> that's a fairly trivial pattern in RDBMS world.
[01:30:12] <pasichnyk> Hey guys, i'm tring to do some realtime counting of event occurences via $inc operator with upsert to store counts of each event occurence in a single document per user/per day (as an example). It seems that the only way to do this, is by storing a lot of separate documents (but these would be tiny and eat up more index/storage space than needed), actually building the schema (i.e., a document
[01:30:12] <pasichnyk> that has a schema like: event.{somespecificevent}.count), or storing just like the previous example, but as an embedded array (i.e., event.["somespecificevent"].count). It seems that if you do the array example, you can easily get the Top 10 events from the document through aggregate(), but you can't do upsert/$inc (with positional updates) to easily feed in data. If you do the method with
[01:30:12] <pasichnyk> properties for each event, then you can't easily select top 10 on the server side because all the aggregation works on arrays or calculations across values multiple documents. Which leaves having a ton of little documents, which seems like a waste in memory/storage/query performance. Is there something I'm missing here, or is the tiny documents method the only real option?
[01:37:14] <pasichnyk> schofld, I haven't done this personally, but you might want to look at having embedded arrays in each event's document, that defines a list of usernames for each type of permission to grant. When you want to give someone permission to "readonly", "admin", "moderator", etc., you could simply add their username into that array. You would then just need to make sure you check what what permissions
[01:37:14] <pasichnyk> a user has when loading the page and proceed accordingly.
[01:38:28] <schofld> pasichnyk: thanks for the idea
[01:39:32] <schofld> pasichnyk: how do you work when planning the db design?? whiteboard? shit load of postits?
[01:40:56] <schofld> (the web app i am designing felt so easy when i was just focusing on the views... feel i am getting a little lost right now)
[01:41:48] <jkitchen> schofld: to be honest, you're probably using the wrong type of database system
[01:42:05] <jkitchen> an RDBMS makes that pattern trivial.
[01:42:12] <jkitchen> hell, I already gave you the 3 tables you need :P
[01:42:18] <pasichnyk> list of reqirements (post its work), white board to put down ideas, make some sample schema, create some documents wth that schema, write some queries against it to make sure it works, rinse and repeat. :P
[01:43:05] <schofld> really?? is mongo the wrong DB... oooo
[01:44:17] <pasichnyk> schofld, i think either rdbms or document db can work just fine for what you're trying to do. Just comes down to what you're comfortable buiding against, etc. The use case sounds fine though to me for either.
[03:22:08] <QbY> Is it possible to store a org.w3c.dom.Document (Java) into Mongo?
[03:43:14] <rm2kdev> we also occasionally get a "Server is no longer avaliable" error
[03:43:27] <rm2kdev> would anyone be able to assist with such an error?
[06:57:44] <jwilliams1> We have a multiple clients on different machines which will, 1st, create a ObjectId (ObjectId.get()); 2nd call DBCollection.save to MongoDB cluster (4 shards). How many possibility to create duplicate ObjectId if we manually call ObjectId.get?
[06:58:30] <jwilliams1> We observe that when calling save the server throws MongoException$DuplicateKey
[11:16:50] <trupheenix> but now assuming that this user has the userAdminAnyDatabase privilege, how do I switch to another database? or how do I run the show dbs command?
[11:17:09] <joannac> you can't. that's not the right role for that
[11:17:22] <joannac> userAdminAnyDatabase is for user admin
[12:18:54] <cheeser> look at what position that one is in the document. that's the index (-1 of course because it's 0-indexed)
[12:25:08] <HSDTHWERTU> OK, cheese, I'll have a look
[12:32:15] <HSDTHWERTU> thanks cheeser for your help
[12:40:21] <HSDTHWERTU> they reelected but the secondarys are still syncing from the old primary, is that right?
[12:50:04] <nameless> Hello. We are using sharing (mongo version 2.2). And had corrupted metadata on 3 config servers. We restored config server from backup and spin up additional config server with it. Since we needed to get system alive really fast - we pointed all 3 domain names to this 1 restored config server (i.e. local-resovled cfg1 - 1.2.3.4, cfg2 - 1.2.3.4, cfg3 - 1.2.3.4). Now we are going to spin up
[12:50:04] <nameless> additional 2 config servers. domain names will remain the same. what is the right procedure to do so? will shuting down config server and mongoses with data rsync-ing will be enough? thanks a lot for any help.
[13:40:29] <tiller> Since I added a keyFile to my mongod(s) and mongos(s) services things are not going well ;o
[13:40:45] <tiller> When I try to do a : sh.status() on one of my mongos, I've: "$err" : "not authorized for query on config.version"
[14:00:06] <prawnsalad> hi - ive run out of disk space and trying to delete documents to reclaim some back. but .remove() shows the error: Can't take a write lock while out of disk space
[14:00:35] <prawnsalad> ive deleted all that i can for now on the server, is there anything else i can do to just delete docs?
[14:04:33] <Nodex> prawnsalad : do you not have a larger disk you can symlink to while you compact it?