[01:27:53] <cheeser> they all blur together for me.
[01:27:57] <joannac> AbuDhar: there are a steady stream of people through this channel who use mongoose without really understanding mongodb, and get themselves into trouble
[01:28:14] <joannac> if you're going to use mongoose, make sure you understand what it's abstracting
[03:54:50] <krebipeti> i have read about mongodb replication
[03:57:25] <krebipeti> i would like to create a system which is insert data on the primary server, and all read will be balanced to the secondary server. i'm thinking about spreading the load between read/write
[03:57:58] <krebipeti> it will be one write server and maybe 2 or 3 read server
[03:58:18] <cheeser> replication isn't for that. it's more about durability.
[03:58:32] <krebipeti> so to achieve that...what should i do?
[03:58:48] <cheeser> if your system is that busy, look in to sharding.
[03:59:41] <krebipeti> ahh...alright. i'm actually a bit confuse when to use replication and when to use sharding. so i can do that by sharding?
[04:00:28] <cheeser> sharding is for spreading read/write loads. replication is for durability and failover.
[11:01:33] <Sp4rKy> Hi, I have a replicaset with a primary and a secondary. I want to remove the secondary (so that I move to a standalone instance) and remove the db from the (old) secondary
[11:02:03] <Sp4rKy> I used rs.remove to remove the secondary from cluster, but then I get "not master" when trying to remove the db on the secondary
[11:02:19] <Sp4rKy> I guess I should get ride of the RS config on the secondary ?
[11:17:12] <coudenysj> Sp4rKy: are you issuing the remove command on the secondary or on the primary?
[11:17:15] <einyx> is upstart broken in the upstream version of mongo?
[12:38:19] <djMax> I have a 3 member replica set that got "moved." All the hostnames are now different. I can't seem to reconfig them as it keeps telling me "LOADINGCONFIG" failed. Is it possible to revive them?
[12:41:17] <deathanchor> djMax: not recommended, but you could start them up standalone and modify the local db where the replica info is stored. (db.system.replset) then bring them all back online
[12:42:09] <djMax> and my attempts to reconfig() are meant to (and will forever) fail?
[12:42:32] <deathanchor> yeah I had that issue once, let me check my notes real quick
[12:44:23] <deathanchor> yeah, what I did was just trust one to be the primary. stated it in standalone, dropped the 'local' db and started it up in replset, and did an rs.initiate() on it, then added the other hosts one at a time.
[12:44:53] <deathanchor> but you might be able to "force" it by changing the local db directly
[12:45:05] <djMax> interesting. And blew away the db entirely on the others? Or just let replication take care of it?
[12:45:09] <deathanchor> again not a recommended action
[12:45:22] <djMax> If only there was a recommended option :)
[12:45:23] <deathanchor> replication will automatically drop things
[12:45:56] <deathanchor> but I don't think the others will allow it to sync if it has an old config in place
[12:46:18] <deathanchor> so you need to blow those away too (or config them manually in standalone mode)
[12:46:31] <cheeser> the recommendation, i think, is to add new replica set members on the new hosts and remove the old ones one sync is done
[12:49:41] <djMax> hmm, it's saying I'm not authorized to update the db.system.replset collection
[12:51:31] <cheeser> the user matters less than the role but i'm not sure the exact role name.
[12:51:41] <cheeser> for my tests, i have a user with the 'root' role
[12:52:19] <deathanchor> since you are starting it in standalone to make the small mod, why not just turn off auth and just do a bind to the localhost to avoid anyone else using it while you mod the local db?
[13:18:49] <djMax> logs seem quiet, rs.status() says everything is fine
[13:41:08] <nalum> hello all, I'm running an aggregate function to add 7 hours to a date, is there a way to restrict it to only affect documents that have a specific value set in a field?
[13:56:49] <vagelis> Oh cool thanks guys. Ok i have a mongodb question, may I ask please?
[13:57:37] <deathanchor> vagelis: you don't need to ask permission to ask a question related to mongo (or it's various flavors)
[14:00:49] <vagelis> Well I had the impression that even though the room is called Mongodb its not supposed to be a place for questions :s I dont i just had this impression. Ok so, my question is, well I am trying to understand the explain(). So in winning plan the inner brackets say IXSCAN. Even though the query is find({ random_field { $gt: 5 } }).sort({ index_field: 1 })
[14:01:21] <vagelis> So even though the query doesnt use an index for find, it uses index for sorting.
[14:02:06] <vagelis> The answer to the question if query uses index to find and match document is NO why the inner brackets show IXSCAN?
[14:02:51] <vagelis> I know the answer but I cant understand it from the explain().
[14:04:21] <vagelis> random_field is just a random field. index_field is a created index. I tried to name them like that so you can understand.
[14:06:39] <deathanchor> vagelis: not sure of the question exactly, but if the query uses one index, then the sort will either use the same index or not at all.
[14:06:58] <deathanchor> well that's my experience with old old mongo 2.2
[14:07:00] <vagelis> no the query doesnt use index
[14:07:27] <deathanchor> vagelis: it has to use some index, even if it is the worst one ( _id ).
[14:07:49] <deathanchor> how about sharing a gist of the explain output?
[14:07:54] <vagelis> btw in the key_pattern says that use index_field: -1
[14:08:05] <vagelis> but i dont get it how it uses it
[14:08:48] <vagelis> Maybe if theres no index in the find(), it looks in the sort() if theres one?
[14:11:52] <deathanchor> how about sharing a gist of the explain output? you can sanitize any private info
[14:12:58] <vagelis> well i dont know what is supposed to be private info :S i am currently in the mongouniversity and I dont know what should/should not show
[14:13:20] <vagelis> let me create a similar by my self and show to u
[14:16:27] <vagelis> Ok here: https://bpaste.net/show/1675e4a972f6
[14:17:33] <vagelis> Also i dont get why it does it backwards. I asked that and I am waiting an answer but this is less important for me right now.
[14:21:50] <deathanchor> ok, so the query didn't use an index to filter because random_field wasn't indexed, but the sort was indexed, so I used the index for sorting only it appers.
[14:22:30] <deathanchor> I'll need to read up more on explain("executionStats"), that's new to me
[14:22:54] <deathanchor> I've always just used a cursor explain
[14:22:55] <vagelis> ok deathanchor thanks for ur effort
[14:24:14] <deathanchor> vagelis: I have no mongodb 3.0 exposure, (hence my stating I'm always on the old old fogy version of 2.2, 2.6)
[14:24:35] <vagelis> no problem guys thanks for ur responds
[14:28:25] <fxmulder> so I found that after setting up sharding and migrating data, the original shard still contains the old migrated data leading to duplicate documents between the shards, whats the best way to clean that up?
[14:29:25] <cheeser> maybe this http://docs.mongodb.org/manual/reference/command/cleanupOrphaned/
[14:33:05] <fxmulder> cheeser: that sounds promising, thanks
[14:56:11] <deathanchor> saml: you can also try a strings on all the files and grep and hope you find something useful
[14:58:53] <fxmulder> should I have an admin database?
[14:59:44] <deathanchor> fxmulder: it's a special db
[15:00:25] <GothAlice> fxmulder: "admin" and "local" are used to control MongoDB behaviour and store internal state.
[15:01:08] <deathanchor> admin doesn't always show up when doing a show dbs.
[15:04:14] <GothAlice> It's automatically created the first time it's needed. I.e. when adding the first user after enabling authentication, when setting up a replica set or shard array, etc.
[17:13:25] <shlant> anyone know how I can give truly "full access" in mongo short of assigning every role to a user? My app seems to not be able to access some data or create some db's and in attempting to troubleshoot if it's permissions, I tried using a "root" user, but that doesn't seem to give me the "full access" permissions I want.
[17:18:36] <tejasmanohar> does indexing a field make it necessarily forced to be unique?
[17:22:46] <tejasmanohar> or whats the very definition of an index
[18:25:32] <Argorok> Hi! How can I sum a field and group by dayOfWeek? I wanna build a query that retrieve for me the sum of the field grouped by day of week of another field
[18:26:38] <deathanchor> Argorok: Aggregation framework, useing $project, $dayOfWeek, and $sum
[18:32:36] <Argorok> No problem :D Hmmmmm, project is like projection and not a project itself. I was reading the word project and translating in the wrong way when I first read