PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 16th of December, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[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:26:43] <Ciaro> woops, had to be @joannac
[00:26:47] <Ciaro> :)
[00:28:43] <joannac> Yes, that should be parent
[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
[00:34:18] <Ciaro> let me read it ^^
[00:40:19] <Ciaro> joannac: he shouldn't need to take the field 'ancestors', no?
[00:41:13] <Ciaro> *yes :p
[00:43:39] <Ciaro> but _id instead
[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:25:36] <jkitchen> sure
[01:25:44] <jkitchen> schema
[01:25:49] <jkitchen> structure, design, etc.
[01:26:26] <jkitchen> like I said, I don't know how you would implement that sort of design in an ideal mongo world. mongodb doesn't have "joins"
[01:26:45] <jkitchen> you could maybe nest the events inside each user, or nest users inside the events.
[01:26:58] <jkitchen> I think?
[01:27:11] <jkitchen> http://docs.mongodb.org/manual/reference/database-references/
[01:27:12] <jkitchen> yea
[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:43:15] <schofld> (sigh)
[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:22:19] <QbY> as the actual object?
[03:38:16] <rm2kdev> hello
[03:38:43] <rm2kdev> are there any c# driver users out here?
[03:38:45] <rm2kdev> :)
[03:41:15] <rm2kdev> Ive got a really weird error using c# driver 1.8.3.9
[03:41:39] <rm2kdev> We have a collection with 8000 records in it when i try to return them all via the c# driver
[03:42:10] <rm2kdev> i get an error stating "No such host is known"
[03:42:30] <rm2kdev> so we switched from using asqueryable and linq to collection.findall()
[03:42:44] <rm2kdev> then i used a foreach loop it returns about 1000 items before it crashes with that same error
[03:42:56] <rm2kdev> I've increased the connection and socket timeouts
[03:43:03] <rm2kdev> with no luck
[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
[06:59:31] <jwilliams1> E11000 duplicate key error index: db_name.collection_name.$_id_ dup key: { : ObjectId('...')}
[07:18:37] <jwilliams1> driver version is mongodb java 2.10.x
[10:09:39] <randyg> is mongorestore the only way to import collection metadata?
[10:41:08] <bosky101> how should my geoloction index be configured, if lat and long are seperate fields?
[10:47:58] <Nodex> define "configured" ?
[10:48:18] <Zelest> #DEFINE configured;
[10:48:21] <Zelest> did I do good? :D
[10:49:02] <Nodex> +10 ;)
[10:49:12] <Zelest> :P
[10:49:15] <Zelest> how's things?
[10:49:36] <Nodex> not bad mate, you ?
[10:49:49] <Zelest> to be perfectly honest, utterly crap.. :P
[10:49:53] <Zelest> but meh, that's life
[10:50:06] <Zelest> finally back at work at least.. been home with a sick kid for the last week
[10:50:27] <Nodex> :(
[11:02:31] <trupheenix> I am having difficulty setting up mongodb authentication. Can anyone help me out?
[11:10:04] <joannac> trupheenix: going to need more information than that
[11:10:52] <trupheenix> joannac, I cannot seem to be able to create a user with privilige userAdminAnyDatabase
[11:11:16] <joannac> erm...
[11:11:18] <trupheenix> joannac, when I turn auth=true, I cannot access any database from command line even after authentication
[11:11:20] <joannac> what are you doing?
[11:11:32] <trupheenix> joannac, I want to create an admin user and an app user
[11:12:12] <trupheenix> joannac, also setParameter = enableLocalhostAuthBypass=1 seems to do nothing :(
[11:12:24] <joannac> okay, and the 2 users are against which database? and what roles?
[11:12:42] <trupheenix> joannac, one of them is in the admin database with userAdminAnyDatabase privilege
[11:12:59] <trupheenix> joannac, the other one is an app user with readWrite privilege and limited to the application database only
[11:13:04] <joannac> okay
[11:13:28] <joannac> so you connect to the app database, auth with the app user, and you can't access collections?
[11:14:39] <trupheenix> joannac, hmmm I am trying to check the admin user
[11:14:53] <trupheenix> joannac, It's not clear how to login from the command line
[11:14:58] <joannac> use db
[11:15:11] <joannac> db.auth("user", "pass")
[11:16:22] <trupheenix> joannac, ok this works
[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
[11:17:28] <trupheenix> joannac, oh ok
[11:17:47] <trupheenix> what is exactly a userAdminAnyDatabase supposed to be doing then?
[11:17:55] <joannac> user administration?
[11:18:06] <joannac> adding users, deleting users, giving users privileges
[11:18:24] <trupheenix> joannac, ok
[11:18:38] <trupheenix> joannac, how about something which spans all databases? Am I looking at clusterAdmin then?
[11:18:53] <joannac> depends what you're doing
[11:19:06] <joannac> you may want readWriteAnyDatabase instead
[11:19:13] <trupheenix> joannac, I want to be able to see all databases on my system
[11:20:01] <trupheenix> joannac, dbAdminAnyDatabase ?
[11:21:06] <joannac> that would let you do "show dbs", i think
[11:32:43] <trupheenix> joannac, yup that works
[12:14:45] <HSDTHWERTU> hello all, wyhen trying to change the priority on my repset, i have this error:-
[12:14:47] <HSDTHWERTU> cfg.members[5].priority = 0
[12:14:47] <HSDTHWERTU> Mon Dec 16 12:06:34.519 JavaScript execution failed: TypeError: Cannot set property 'priority' of undefined
[12:14:57] <HSDTHWERTU> what am i doing wrong?
[12:17:06] <cheeser> print out cfg.members and make sure [5] exists
[12:17:26] <cheeser> how many members in your set?
[12:17:34] <HSDTHWERTU> yes it does
[12:17:35] <HSDTHWERTU> "version" : 19,
[12:17:35] <HSDTHWERTU> "members" : [
[12:17:35] <HSDTHWERTU> {
[12:17:35] <HSDTHWERTU> "_id" : 5,
[12:17:35] <HSDTHWERTU> "host" : "production4:27017"
[12:17:36] <HSDTHWERTU> },
[12:18:00] <HSDTHWERTU> there are 4 at the moment, 0 to 4 are no longer with us
[12:18:08] <HSDTHWERTU> only 5 to 8
[12:18:13] <cheeser> you should use a pasteing
[12:18:16] <cheeser> pastebin
[12:18:30] <cheeser> but anyway, that _id isn't the array index.
[12:18:38] <HSDTHWERTU> oh
[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:39:02] <tiller> hi there
[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?
[14:34:03] <tiller> =/
[15:08:37] <mr_fribble> hi
[15:08:56] <mr_fribble> anybody knows a example database for mongoDB to execute examples?
[15:36:46] <mr_fribble> anybody knows a example database for mongoDB to execute examples?