[01:59:33] <Trinity> how do you guys deal with mongodb race conditions?
[02:00:09] <Trinity> for instance, I want to update a document based from a find query on that document previously
[02:01:08] <Trinity> I know I could use implicit application specific logic to guarantee that I never enter a race condition due to not updating those documents/fields concurrently but it does not seem like a good method
[02:09:18] <Trinity> hmm, i guess I could also use something like redis-lock to manage it if I have clusters
[02:09:30] <Trinity> but that doesn't solve the problem if I have more than one system
[02:13:31] <Trinity> wait, I think redis can support multi-systems
[04:58:05] <trq> Iv'e done this before in my dev environment, but am now needing to do some data merging in our staging environment.
[04:58:40] <trq> Are there any consequences to running a mongorestore and trying to import data into already existing databases?
[04:59:01] <trq> The export from mongoexport has mostly the same data but some new data.
[04:59:34] <trq> On my dev box I got a whole bunch of errors due to indexes already existing, but in the end, it seemed to work.
[05:01:29] <trq> The alternative is to restore these databases into temp databases then create a script to loop through all there collections looking to for docs that don't exist in the proper databases and inserting them.
[07:02:47] <afp> I have taken a mongodump from a standalone mongod instance on a box I have, moved the data to a new box and have tried to do mongorestore and it appears to be stuck in some form of a continuous loop
[07:04:36] <afp> https://puu.sh/qfYhC/0720a4eb0b.png Here is an example of what I mean
[07:05:12] <afp> not sure if it is important, but the mongod instance I am trying to do mongorestore to is a member of a replica set: rs1.. I did specify rs1/127.0.0.1:27017 as the host as per docs
[07:05:22] <afp> but yeah.. pretty confused, i've never seen anything like this before
[09:48:20] <mroman> What do you do when you have {_id : 'key', 'B' : 5}, {_id : 'key', 'C' : 6}, {_id : 'key2' : 'B' : 4}, and you want everything where 'B' < 10 and 'C' > 3 or something like that.
[09:48:58] <mroman> you obviously can't just do {'B' : {$lt : 10}},{'C' : {$gt : 3}} because these are in different documents.
[09:49:31] <mroman> The only way I know of is to do a group, but that has horrible implications later on.
[09:50:32] <mroman> (especially since grouping requires disk use and in general it seems to take minutes to group just a couple of million documents)
[09:59:21] <mroman> http://codepad.org/5HcsW9Yj <- that's my problem.
[12:13:33] <cheeser> mroman: i'm heading in to the office (and I may not have an answer for you even still) but it'd help to see your agg pipeline
[14:04:30] <wspider> didn't try it before because I got mislead by my misunderstanding of a stackoverflow answer,sry
[14:05:13] <mroman> I wouldn't consult stackoverflow before at least searching 15min through documentation.
[14:05:29] <mroman> That's a general advice from me :p
[14:06:31] <mroman> Even if you end up not finding what you were looking for and have to consult IRC, stackoverflow you probably will stumble over other things that you can later come back to.
[14:07:01] <mroman> also... security and safety and best practice advice is usually mentioned in the docs more often than in forum answers.
[16:20:58] <wspider> hmm, weird.. it works using the interactive shell but not in nodejs
[16:28:33] <wspider> I think it's because of mongodb versions..
[18:24:31] <wspider> mine was an implementation fault, sry for the spam :P
[23:04:45] <afp> https://puu.sh/qfYhC/0720a4eb0b.png Here is an example of what I mean
[23:04:59] <afp> I have taken a mongodump from a standalone mongod instance on a box I have, moved the data to a new box and have tried to do mongorestore and it appears to be stuck in some form of a continuous loop
[23:05:05] <afp> can anyone answer this question pls?