[00:02:37] <swak> How do I target it by the key "Name" instead of by doing a search for the values.
[00:25:40] <pasichnyk> Ok, might have some more info. Looks like when the cpu really spikes, is when a large (in this case 192k) update comes in, that increments a ton of values in a single document. That use case should be supported fine right?
[00:44:14] <jkitchen> some stray bits floating about
[00:44:37] <swak> Any idea how to delete an entry based upon a key instead of the value?
[00:47:25] <pasichnyk> ok, does this spark any ideas? I see this right about when my mongod goes to 100% cpu for 10 seconds or so:
[00:47:29] <pasichnyk> Thu Jan 16 16:34:48.682 [conn149] serverStatus was very slow: { after basic: 0, after asserts: 0, after backgroundFlushing: 0, after connections: 0, after cursors: 0, after dur: 0, after extra_info: 0, after globalLock: 0, after indexCounters: 0, after locks: 0, after network: 0, after opcounters: 0, after opcountersRepl: 0, after recordStats: 8929, after repl: 8929, at end: 8929 }
[00:47:48] <pasichnyk> took 9s to get server stats, seems odd right?
[01:05:22] <pasichnyk> Ok, this might be something. When the server peaks out at 100% cpu for up to 30s at a time, the only active command showing in the db.currentOp() is showStats, and here its taking over 19s. Is that a symptom of something or the cause? http://pastebin.com/gUNMRdYu
[01:13:13] <DrStein> In this guid: http://docs.mongodb.org/manual/tutorial/migrate-config-servers-with-different-hostnames/ it says I should shutdown all the config servers, but it doesn't say when should I restart them. I presume I should do that after restarting the shards. Am I right?
[01:46:04] <radioact1ve> quick question, cant seem to find solid docs on google. How well supported is C# driver on mono?
[01:46:19] <radioact1ve> tied to a particular version of mono?
[01:50:36] <patricioe> :cheeser you around? Any idea what's up with Morphia 0.106-SNAPSHOT (and also .105) and the @references? They seem broken when querying a document that contains a DBRef.
[02:17:55] <cheeser> patricioe: they're not broken as far as the unit tests show.
[02:21:19] <patricioe> I see. Our tests failed after upgrading.
[02:21:36] <patricioe> cheeser: see my last comment http://stackoverflow.com/questions/19841494/morphia-serialization-error-when-updating-object-with-list-of-references
[02:22:45] <cheeser> did you save the @Referenced objects first?
[03:04:53] <cheeser> patricioe: i'll check it in the morning when I get back in to the office.
[03:05:03] <cheeser> not *quite* set up here just now.
[03:05:32] <patricioe> thank you. I figure you just moved? :)
[03:06:47] <cheeser> nah. home for the evening. this laptop isn't quite set up to run morphia tests.
[03:38:22] <mrpoundsign> quick Q. I have a collection of a bunch of {x: int, y: int, color string, updated timestamp} and I want to be able to say "show me all the distinct <x> and <y> before <timestamp> ordered by <timestamp: -1>" -- is this possible? I want to show a representation of a pixel canvas at a given snapshot. I am logging all actions, but some may be very old.
[05:48:46] <b_oneal> Hey anyone know of a way to find a mongos server from a config server?
[05:49:11] <b_oneal> As in who all is running mongos and connected to the cluster
[05:50:17] <b_oneal> I also want to know given one config server who the other two are - but if I had a mongos server I would have that information.
[06:20:47] <lkthomas> hey guys, something I don't understand with MDB, if all object is based on hashkey and data, how should I store hashkey at the first place ? does it means I have to use another DB to store the hash ?
[06:22:31] <trupheenix> can anyone here help me with searching text in an array? I have multiple regexes and I want all of them to match in the array in order for a result to be accepted.
[07:42:45] <yujin> hi guys, i was using db.collection.findAndModify, but it kept giving me an error of "exception: must specify remove or update", but i have specify, query and update
[07:42:54] <yujin> do anyone encounter this before?
[07:49:50] <trupheenix> anyone here who knows how to use $elemmatch with pymongo?
[07:52:35] <megawolt> @yujin could you send your query with pastie.org?
[08:00:32] <trupheenix> megawolt, can you help me with a pymongo query?
[08:00:43] <trupheenix> megawolt, I am confused on how to use elemMatch in pymongo
[08:00:53] <megawolt> sorry trup i'm developing with c#
[11:28:13] <strangewildthing> How do I use mongo (probably the aggregation framework) to select a query which groups together distinct fields?
[11:31:48] <strangewildthing> Something like this? http://jsfiddle.net/XNm78/
[11:32:31] <strangewildthing> it seems to work, but i created the query randomly... can anyone explain why we assign an object containing the fields we want to "_id"
[11:32:40] <jeanre> anyone here use mongoose, and particularly mongoose-tree2?
[11:33:00] <jeanre> its completely discarding the deleted:false, as it returns objects with deleted:true
[11:33:01] <strangewildthing> and what does "$field1" mean in the line "{field1: "$field1", field2:"$field2"}"
[13:24:53] <Lobosque> I want to store in mongodb all cities for each state. How do you guys recommend doing this? I was thinking of {state: 'XX', cities: Array('City1', 'City2',...)}
[13:25:37] <megawolt> that depends how do you want to use them
[13:25:56] <megawolt> but i suggest subdocument more than array
[13:26:33] <Lobosque> megawolt, this will be read only, just so I can fill a form via ajax once you select your state
[13:27:07] <Lobosque> megawolt how would that be? Sorry I'm new to mongo and still wrapping my head around it
[15:20:46] <ShortWave> Anyone here use Node.js with mongo? I'm lost on this ObjectId() business, I keep getting duplicate records even tho I'm setting the target ID to _id : ObjectId(someId);
[15:23:45] <cheeser> so you're creating an ObjectId with a seed value and wondering why you get duplicate IDs?
[17:11:53] <patricioe> Also got a patch.will send a PR then.
[17:14:37] <bbfrefv> i'm unable to authenticate with my database. seems like the users are deleted for some reason. also i get, "TypeError: db.adduser is not a function (shell):1" when trying to add a user. why?
[17:36:39] <ruphos> make sure the database you're connecting to is the one where your users have permission
[17:37:17] <ruphos> if your users have privs to db_one but you're connecting to db_two and attempting to auth, it will fail
[17:38:28] <ruphos> db.adduser is failing because the command is db.addUser
[17:44:59] <Iuur> Hej what is the proper way in c# to use implent some kind of multi thread forward iteration? (So I have multiple threads which should get the next item in the collection -> if the end is reached it should go to the first one)
[17:49:15] <b_oneal> Hey anyone know of a way to find a mongos server from a config server? As in who all is running mongos and connected to the cluster.
[17:51:16] <Joeskyyy> b_oneal: Should be in the config database
[17:56:08] <b_oneal> Hmm Seems not to work well with port forwarding or multiple mongos's bound to a box since it pulls the hostname and port from the connection not the registered bind address from mongos... But for most situations I think I can work with this. Any way to force registration of the bind address? This feature is available for connections in databases like MySQL, but not often used.
[17:57:09] <b_oneal> (Building a dev test cluster with 20 servers each with 60 instances and thus building a lot of auto discovery automation)
[18:06:35] <bbfrefv> ruphos: ah thanks. capital U made the difference. apparently the users had been deleted though. i had to add them again. how could that have happened? i never deleted them and no one else has access to the server
[18:15:06] <remote> can I ensure uniqueness of an id field only if another field is set to a specific value?
[18:19:11] <jiffe> mongodb needs to move to an auth by default model
[18:21:19] <cheeser> it makes dev environments less pleasant, though
[18:21:44] <cheeser> and, ime, what the auth/role set up should look like isn't always clear up front
[18:24:02] <ruphos> bbfrefv: haven't the foggiest what would do that.
[18:25:29] <ruphos> I don't mind the auth set up, but I wouldn't mind if readPref wasn't default set to primary
[18:25:37] <jiffe> I'm guessing there's a lot of insecure setups out there and I've noticed a lot of scanning being done on mongodb ports lately
[18:26:56] <ruphos> if people aren't setting up auth, I doubt they would do much for changing default user / picking a complicated password
[18:27:25] <b_oneal> Auth is not exactly intuitive. Particularly in sharded clusters. I am guessing a lot of people don't use it because they don't understand it.
[18:27:46] <jiffe> Some package managers are getting in the habit of having you setup auth info on install so there is no default
[18:28:05] <jiffe> well maybe that needs to be addressed
[18:28:40] <b_oneal> Other then the local host bypass what default auth is there?
[18:46:03] <aaronds> Hi. New to MongoDB. Just wondering how I can read then update a document, without the possibility of another process reading in between the two? i.e check a field is a certain value before updating it without another process also believing it should update it. If that makes sense...
[18:55:28] <BlakeRG> we added a replica set to our Mongo instance, on the original machine the size of the DB is 17GB but on the new machine it's only 7.9GB... is there some kind of defragmentation that happens when you replicate a DB?
[18:59:29] <tystr_> I'm trying to do a mongodump, and Im' getting the following error:
[18:59:38] <tystr_> assertion: 10320 BSONElement: bad type 121
[19:02:12] <Joeskyyy> BlakeRG: Not entirely sure on this one, but my mind wants to say it's because your original machine hasn't been compacted in a while.
[19:02:34] <Joeskyyy> So, yeah, kinda like a defrag, but it's only moving the data over to the replica, not the empty space in your original.
[19:03:24] <Joeskyyy> Yeah, one of the gotchas of MongoDB by default :P
[19:08:21] <tystr_> googling seems to indicate corrupted data, but running the validate comand on the collection that seems to throw this error comes back ok
[19:27:42] <tystr_> hmm upgrading mongo to 2.2.2 fixed the error
[19:55:26] <bmw0679> Hello, I ran into a really weird situation where I am finding documents with the same _id. I didn't think this was possible. Has anyone seen this happen before?
[20:04:11] <ruphos> I've run into it, but haven't managed to reliably reproduce
[20:09:31] <BlakeRG> is there a way i can see the number of documents i just removed? like "rows affected" in SQL?
[20:44:32] <Joeskyyy> Doesn't indicate you can't use a space char however :\
[20:44:56] <Joeskyyy> It is included on the database names however
[20:45:41] <Joeskyyy> Ah, you can use getcollection, i.e. db.getCollection("derp test").find()
[20:46:37] <ryansteckler> Hi all, I'm trying to figure out a query. I have a model of a car with a passenger. I want to let Alice atomically get in the passenger seat only if there isn't a passenger already. She doesn't want to sit on someone's lap. So far, so good. The problem is that I can't figure out how to make sure she's not already in another car's passenger seat. I have this: findAndModify({id: carId, passenger: {$exists: false}}, {passenger: "alice"})
[20:46:46] <ryansteckler> But this obvisouly lets her get in another car, as well.
[20:47:11] <CaptainFantastic> So I’m getting started with mongo and I’m curious if most people use the CLI or other interfaces? Ex. Stackoverflow gives this as an example for changing user permissions and it feels really non-intuitive :) So what’s the received wisdom … db.users.update({"user" : "testAdmin"}, {$addToSet: {'otherDBRoles.TestDB': 'dbAdmin'}}, false, false)
[20:48:59] <Joeskyyy> CaptainFantastic: Kinda depends on what you're doing? Are you talking about specifically for user administration?
[20:50:00] <CaptainFantastic> Joeskyyy: Kind of all together, right? Is it common to use GUI tools for admin stuff?
[20:50:13] <CaptainFantastic> Or are there thousands of people going: db.users.update({"user" : "testAdmin"}, {$addToSet: {'otherDBRoles.TestDB': 'dbAdmin'}}, false, false)
[20:50:18] <ryansteckler> I thought about or'ing the query with something like {passenger: "alice"}, then failing the update if it returns more than one row, but findAndModify doesn't do that on multiple results. It modifies one of them, and since it's atomic, I can't check, then go ahead with the modify.
[20:50:44] <ryansteckler> (sorry if someone said something in response - client Dcd for a sec…)
[20:51:31] <Joeskyyy> CaptainFantastic: I mean if I'm importing a whole bunch of users or something, then I'll script it. But for most of my DBA style stuff I use the CLI.
[20:52:09] <Joeskyyy> ryansteckler: You'd probably want to two step that.
[21:17:31] <swak> So I've found this but how would I use it to target the key instead of the value? http://docs.mongodb.org/manual/reference/operator/update/unset/
[21:35:58] <CaptainFantastic> Is my understanding correct that if you are using vanilla Mongo (non SSL) and are accessing remotely, all the data + user authentication is being passed plain text and is thus a massive security hole?
[21:36:37] <BurtyB> swak, if you know all of the fields that might exist you could check for their existance but that's going to be horrid imho
[21:37:45] <Joeskyyy> I just whipped up this java scrip function that works for me one a collection where I had some that just had a few docs with just an _id
[21:38:31] <Joeskyyy> It looks at the keys.length function to find out how many keys a document has
[21:38:50] <Joeskyyy> If it only has one key (since every doc needs at least 1 key, an _id) it should remove only the docs with _ids
[21:45:18] <Joeskyyy> CaptainFantastic: To answer your question simply, yeah. It's just a basic TCP connection so it's all getting sent plain text over the wire.
[21:47:42] <swak> Joeskyyy: I'm getting this error: TypeError: Object #<Cursor> has no method 'forEach'
[21:49:02] <Joeskyyy> Hmmm, works just fine on my end
[21:52:59] <Joeskyyy> You can however, load that in a local javascript file, and invoke it in your node.js code? I'm not gonna lie I'm very ignorant when it comes to node
[21:53:06] <Joeskyyy> Really need to learn it, just haven't taken the plunge
[21:57:52] <Joeskyyy> swak: can you try .each instead of forEach?
[21:58:37] <Joeskyyy> Looks like a Cursor obj in the node.js drivers has that availability. "cursor.each(function(err, doc){}) retrieves all matching records one by one.
[22:27:01] <swak> ruphos: that doesn't seem to do anything either.
[22:28:41] <Joeskyyy> If all else fails, eval should do it, http://mongodb.github.io/node-mongodb-native/api-generated/db.html?#eval i've used it in python before. of course you'd need to make a connection inside the eval to mongo and your db
[22:31:06] <ruphos> hmm. I don't write the node, but I have to deal with when it fails. lemme grep through some source and figure out how we handle that
[22:32:13] <swak> still no effect: db.eval('db.test.find().forEach( function(doc) {if (Object.keys(doc).length ==1) {db.test.remove(doc)} })', function (err, inserted) {});
[22:32:29] <swak> Still no effect wrapping the original function in eval
[22:32:32] <Joeskyyy> You need to open a connection inside the eval.
[22:54:52] <Joeskyyy> Try ruphos' idea. If not, maybe try something similar to this inside the if statement: http://mongodb.github.io/node-mongodb-native/markdown-docs/queries.html#id-values
[22:55:20] <Joeskyyy> the toHexString part that is.
[22:55:33] <Joeskyyy> That way your query is actually using a string of doc._id