[04:42:01] <ryn1> db.table.update({},{$set : {field':'appendString'+'field'} }, false, true); <-- how can I make this work? im just trying to update a field, all i want is to attach a string value to the current value of the said field
[06:40:29] <coalado> I have a list of long values. I'd like to group on value/500 to count all docs that have a value 0-500 500-1000 1000-1500 and so on.
[06:41:35] <coalado> I tried {$group:{_id:{$divide:[$value,500]}} but the result does not look very promising
[08:44:54] <kristuttle> Okay I have been trying to solve this simple problem for about 10 hours. I'm using this bit of code to simply save data but it creates duplicates instead of updates.
[08:45:19] <kali> kristuttle: you need to show us the code
[10:01:35] <NodeX> you can try itterator method but I dont think it will work, I haev a findAll() method in my wrapper that looks the cursor and puts the results into a cache for times when I need all the results
[11:55:27] <fredix> I try to extract file from gridfs chunck by chunck, but I get this error : ERROR: MessagingPort::call() wrong id got:40 expect:41
[11:56:55] <fredix> my code fail on this loop : https://github.com/nodecast/ncs/blob/master/zeromq.cpp#L1507
[12:19:26] <kml> Hi, is db.serverStatus()['connections']['available'] == maxConns; I have "available" : 815 but in logs I see "1946 connections now open"
[13:28:09] <rh1n0> does a mongo cluster use a load balancer like tradional clusters (sitting in front) or does/can the application adapter do all necessary logistics?
[13:28:40] <NodeX> it's called a mongos and it effectivly routes the reads/writes
[13:29:28] <Derick> but you can (and should) have one for each application node (up to certain limits)
[13:38:25] <rh1n0> thanks - the reason i ask is we have a rails app using mongoid and for whatever reason it complains occasionally that it cannot connect to the primary. Sure enough the primary died. No idea why. Was hoping it would bounce over to another node instead of stopping.
[13:38:57] <rh1n0> oh mongos is the balancer? need to look that up
[13:50:56] <oskie> Hello, during normal backup MongoDB will failover. I don't know if this is because of CPU/IO starvation or typical mongo behavior. Does anyone know if it is normal? (I'm considering doing LVM backups instead.)
[13:51:41] <Derick> It's likely IO starvation - but you should be able to check that with vmstat - see what happens to swap in/out f.e.
[13:53:00] <oskie> This is on Amazon, so I suspected IO starvation. Then LVM will most likely not help, will it?
[13:53:33] <fredix> ok in fact it seems that the c++ driver is not tread safe
[13:55:31] <Derick> oskie: i think that'd make a FS snapshot - but I don't know the technology well enough to comment on
[13:57:33] <oskie> Derick: yep, it would make a full FS snapshot. But after the snapshot operation I will read the full snapshot from disk into a file (image), so that I can take it offline. And that read/write could result in IO starvation as well
[14:52:10] <Bartzy> So actually there are no "best practices" or general standards for the config file or any config (even shell) for that matter - right ?
[14:59:16] <Bartzy> kali: Such a relief from the black magic in my.cnf :p
[14:59:53] <kali> Bartzy: FYI, i'm a big mongo user, and i don't bother with config files. I pass everything on the mongod command line
[15:00:19] <kali> Bartzy: i prefer to have everything in one single place
[15:04:53] <Electro> http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/ specifies that i should use glibc-2.12-1.2.el6 to avoid a known bug. Debian Squeeze has glibc-2.11.3-3. Anyone known if that version have had the known bug fixed and backported?
[16:10:06] <xico> If it would be stored as a String
[16:18:30] <cmendes0101|> In mongo? I don't think so
[16:18:55] <xico> There is a special system collection called system.js that can store JavaScript functions to be reused. To store a function, you would do:
[16:19:05] <xico> Taken from: http://www.mongodb.org/display/DOCS/Server-side+Code+Execution
[16:19:13] <xico> I guess there is, but they advise not to use
[16:22:25] <Neptu> hej how can i see the name of my replica set??
[16:33:24] <bhosie> i'm perplexed by my replica set's behavior. i've been putting it under stress tests and when i overload it with writes, my two secondarys (members[1],members[2] go down and members[0] goes from primary to secondary. the [1] and [2] never come back up and [0] gets stuck as a secondary permanently. i'm not sure why my set falls apart and never recovers.... http://pastebin.com/TwTFkjr8
[16:34:11] <bhosie> the only way to fix it is to restart mongod on 1 and 2
[16:36:34] <timeturne> why does it fall apart in the first place
[16:37:05] <bhosie> during stress tests where i'm feeding it tons of writes
[16:37:19] <bhosie> Tue Oct 9 03:28:59 [rsSync] warning: DR102 too much data written uncommitted 314.618MB
[16:42:38] <fjay> bhosie: perhaps a case for using a safer write level?
[16:49:02] <bhosie> fjay: ok cool. so is 'normal' the default write concern for mongo?
[16:49:21] <Bartzy> if I have a replica set and I connect with the shell to the secondary - and make changes - will they be made on the master? Also - how in the shell I connect to the master - no matter which host I specified ?
[16:50:02] <fjay> bhosie: i can't recall.. i usually just set it to what i want it to be to avoid any sort of confusion
[17:07:06] <Bartzy> and it doesn't really matter if I'm doing maintanence and usually mongo-01 is the primary, but now mongo-02 is the primary - right ?
[17:09:23] <Bartzy> I have only 2 mongod and 1 arbiter
[17:10:00] <Bartzy> but why not rebooting 2 secondaries and leaving one master ? BEcause it will make it secondary because it doesn't have a majority ?
[17:10:38] <Bartzy> Hope it will be OK. I read it doesn't do much
[17:11:06] <Bartzy> Gargoyle: So how do I : 1. Put a secondary down for maintenance ? 2. Put a primary down for maint ?
[17:11:32] <Bartzy> 1. Just stop mongod gracefully and shut down the server, when it will be up and mongod will start again - it will resync (with respect to oplog size on the primary) ?
[17:11:50] <fjay> do a db.serverShutdown on the node
[17:11:52] <Gargoyle> Bartzy: Theres a page on the docs. But basically, take your secondary down (making sure primary and arbiter are in good order) then update your secondary.
[17:11:53] <Bartzy> 2. rs.stepDown(30) on the master - assure it's now secondary - and then just do the same ?
[17:11:54] <linsys> Bartzy: For a secondary yes, for a primary you want to use the rs.stepDown command
[17:11:56] <fjay> and there is a means to step a primary down
[17:12:15] <Bartzy> ok - why the docs say 120 seconds ?
[17:12:25] <Bartzy> Just for good measures ? It can be 10-20-30 seconds in stepDown ?
[17:12:43] <Gargoyle> Bartzy: Yeah, once your secondary is back up, rs stepdown will demote the primary. But, only if the secondary has caught up.
[17:13:00] <Bartzy> so basically no need to demote the primary
[17:13:25] <Bartzy> just make the secondary (old primary) catch up, and that's it. Now old secondary is current primary and old primary is current secondary. And all is OK? :P
[17:13:25] <Gargoyle> If the secondary is still catching up, the primary will not stepdown.
[17:13:47] <Bartzy> Yeah but why should I stepDown the new primary after the maintenance on the old primary ?
[17:27:59] <Bartzy> I have another question for everyone - I'm now migrating a lot of data to mongo (about 150 million documents). I already have the (empty) servers in the replica set set up. Should I remove the secondary from the replica-set until the migration is done - and then re-initiate the replication so the entire data will move - or just keep the replication enabled ?
[17:29:18] <Derick> Bartzy: yes, feel free to test ;-)
[17:29:34] <Bartzy> Derick: Thanks - when do you reckon it will be marked as stable ?
[17:29:48] <Derick> when we are ready - RC1 this week is what I hope
[17:32:31] <jawr> hi, i'm trying to enforce unique keys with the c++ driver: conn.ensureIndex(database + container, BSON(key << 1), true); but it doesn't seem to be working; when i do an update it allows fields that should be unique
[17:42:33] <timing> What is the best way to copy a few documents to the same collection in another database? I want to copy some stuff from production back to the development db
[17:42:35] <jawr> ah, it looks like ensureInde doesn't overwrite any old indexes
[17:42:55] <timing> I can write a script, but I don't know if thats the way to go
[18:14:29] <_m> timing: Dump/import with mongoexport
[18:33:07] <gheegh> if i have 2 servers, should i make them a replica set or do sharding.. I'm upgrading from a single mongo server.
[18:35:01] <BurtyB> depends what you want to achieve
[18:36:07] <gheegh> BurtyB: I've got periods where my site gets really sluggish with writes.. we have a batch process that hits the server pretty hard. Then, after that.. it's pretty fast overall.
[18:36:31] <gheegh> But, during writes, we often will timeout the front end waiting on data.
[18:37:40] <timing> Another question, how would you define users having access on a document? can you put a list of users in a document and query on that list? Or is the relational users_posts thing the way to go?
[18:44:03] <_m> timing: We use a relational approach in that instance.
[18:48:35] <leehambley> where does one start to diagnose slow inserts, I'm seeing 14000ms (really.) insers on a 7.5M collection, one index, small docs - https://gist.github.com/83dc565db8a62dd5c191
[19:30:52] <ribo> so, I'm looking to get my mongo cluster off of AWS and onto some dedicated hosts, any one have any reccomendations?
[19:39:11] <hersha> Hi, quick question on a query. I'm running an or query with a sort and it takes forever to run. The query without the sort is fast and the individual queries alone without the $or are fast. I assume I have a problems with indexing but I'm not sure how.
[21:03:44] <timeturne> you can update the secondaries and then manually promote one of the secondaries and then update the primary from the backup secondary
[21:28:52] <mkscrg> when doing an update (no upsert), is there a way to verify that a document was updated (i.e. that the condition was found when the update call was made)?
[21:29:44] <mkscrg> i've seen people suggest doing a search, but that's a non-starter for high-throughput apps with lots of updates
[22:21:00] <mkscrg> so just to clarify, an error will be thrown if the update condition is not met?
[22:28:07] <bhosie> k so i've been googling on this for a while now. how can i specify that i want an array rather than a sub document using the php driver insert() function? same issue as this: http://stackoverflow.com/questions/9633127/error-updating-an-array-in-mongo
[23:16:01] <_m> mkscrg: It will throw an error if the update fails, yes. http://www.mongodb.org/display/DOCS/Connections
[23:18:42] <mkscrg> _m: thanks, I'll give this a try