[09:56:06] <moian> Nodex: here http://docs.mongodb.org/manual/core/indexes/#drop-duplicates
[10:00:29] <Nodex> really ?.... first line of that reads "MongoDB cannot create a unique index on a field that has duplicate values."
[10:00:56] <Nodex> which goes on to say "To force the creation of a unique index, you can specify the dropDups option, which will only index the first occurrence of a value for the key, and delete all subsequent values." ....
[10:01:24] <Nodex> meaning that it will index the first value and drop FUTURE attempts to add the value - it doesn't say it removes the current dupes because it doesn't
[10:03:47] <moian> Nodex: what does `Warning Specifying { dropDups: true } will delete data from your database. Use with extreme caution.` mean then ? I don't understand what it removes
[10:07:28] <Nodex> means it will drop a dupe from your database when you try and insert it
[10:12:22] <moian> Nodex: I'm really convinced that it drops existing duplicates as well, as explained in this answer http://stackoverflow.com/a/5532074 (from Scott Hernandez), and many others
[13:03:48] <AaronB> Hi. I'm trying to get replicasets and authentication to play nice. I've fired up three boxes with mongodb (keyFile specified), I've then added a 'root' user with readWriteAnyDatabase and dbAdminAnyDatabase, I authenticate as them and try to run any rs.* command but it fails with { "ok" : 0, "errmsg" : "unauthorized" }. Anyone got any ideas?
[13:12:08] <n06> Is there something wrong if it looks like i have 60-70 mongo instances running but i only started 1?
[13:16:55] <n06> kali, thanks i think so too, i just changed the layout and its only showing my 1 process
[13:17:33] <jmar777> n06: ya... you can also try ps aux | grep mongod to list just processes
[13:17:37] <n06> 1 more question though: mongo will use all free memory on the system as its workspace, so what happens when there are more than 1 mongod instances running on 1 machine
[13:20:37] <n06> well its interesting, because i see the records in the collection as being evenly spread across the cluster, but one node has a tiny vsize and very little ram usage
[13:25:17] <n06> a cluster with 3 shards and 44 mil documents should be performing better than it is, im very confused by this
[13:56:22] <saml> so are you regretting changing javascript engine to v8 now that spidermonkey has asm.js ?
[14:20:06] <Chammmmm> Hi, I am running on Mongodb 2.4.2 and I am trying to calculate the Working set with the metrics that you proposed.. The working set seems to be bigger(double the size) on the secondaries vs the primary? Is that an expected behavior?
[14:40:09] <perplexa> i think i discovered a minor bug in your php extension
[14:40:56] <perplexa> the pecl version that is, when you dump a mongoclient object, the connected property always says false :P accessing it works, tho. still a bit confusing
[14:51:47] <Derick> perplexa: what do you think it is?
[14:54:47] <perplexa> Derick: don't really know, but the result looks as followed: http://paste.perplexa.be/194
[14:55:55] <n06> whats the best diagnostic tool to find a bottleneck in a sharded cluster?
[14:59:11] <perplexa> Derick: the public property of the dumped object should match the dumped property itself ;p
[14:59:38] <perplexa> havn't tried if that has any negative impact on reflection classes yet
[15:00:18] <n06> when i run mongostat, i see that one shard (more specifically the primary in the replSet that is the shard) is write lcoked at 90% almost constantly, while every other shard is ok
[15:00:36] <n06> but the data is distributed evenly so i dont understand why that would happen
[15:06:42] <Derick> perplexa: can you file a bug report at jira.mongodb.org with a test script please?
[15:29:05] <klj613> hello - using the 'findAndModify' command. is it possible to update a field by using a different field? e.g. update 'date' with the current date + number of seconds which is in the 'interval' field?
[15:29:53] <kali> klj613: no. what you can do is optimistic locking. you pull a document, you change it, and use findAndModify to make sure it's still the same in the db
[15:47:19] <Kosch> Hi, I get "can't find self in the replset config" error, when trying to initiate replset. The DB listens by default on 127.0.0.1:27017. Since the hosts don't see each other (connected by tunnels) I've just a set of ports. So e.g. the current DB is available on every host under 127.0.0.1:23. So I need to add as 1st member '127.0.0.1:27023' instead of
[15:47:19] <Kosch> 127.0.0.1:27017. Is the the cause for the problem?
[15:52:25] <Chammmmm> nm.. found my issue.. dumps are causing the issue
[15:56:52] <perplexa> Derick: https://jira.mongodb.org/browse/PHP-864 - seems i can't properly format the code, tho. thought {{text here}} marks monospaced text ;/
[15:59:06] <perplexa> seems i can't edit it either ;p
[16:00:58] <perplexa> looks much better, thanks for fix
[16:55:48] <jonaswouters> is the online training currently going still doable to pass if you missed the first 3 weeks of homework?
[17:02:34] <Beg_> I'm trying to aggregate all "jobs" based on date, the closest i have come to achieving my goal is, $addtoSet:"$_id", how would I add the whole row instead of just the $_id?
[18:08:37] <AndrewPD> Hey I have this python code that's supposed to remove a string called " u'==WRONG\n i' " from the array in the class field of the match field of the toothbrush field of the environments field of users, but it doesn't seem to change anything. Any idea what I might be doing wrong? http://pastie.org/private/eecf4kmzjlsrikcy1rgvw
[18:09:58] <Nodex> $pull will pull a key from an array
[18:10:08] <Nodex> it doesn't PULL a string from another string
[18:10:48] <AndrewPD> Yeah, it's supposed to pull it from an array at the bottom.
[18:10:57] <AndrewPD> (The bottom of the data structure.)
[18:12:18] <Nodex> just check your collection on the shell.... mongo --may-- have escaped the \n to \\n
[18:13:47] <AndrewPD> This is the list I get back. [u'==WRONG\n i', u'==HELLO\n hi'], and trying to call the removal code with \\n instead of \n doesn't work either.
[18:22:37] <AndrewPD> I've actually just been using an open Python interpretter with pymongo imported as my shell. I have the mongo shell up now, though with the right DB. You want to know what the array looks like, right?
[18:33:39] <Beg_> Alright I figured it out I am the best I win!
[18:33:55] <AndrewPD> Actually, I think I have it. Thanks Nodex. The $pull is correct, but my functions for viewing and adding rules are not.
[18:34:09] <Beg_> I am not used to the concept of mongo, but I should just be more stupid and forget everything i once knew about sql.
[18:44:52] <n06> is there a reason that my cluster is inserting exponentially slower as the database fills up
[18:45:08] <n06> for the first 10 minutes of runtime i inserted 10 million documents
[18:45:19] <n06> for the next 20 hours i inserted a total of 40 million
[19:22:20] <harenson> n06: send the pizza to ehershey xD
[19:27:29] <BrenCom> hi, looking for some support. have installed mongodb on Ubuntu 12.04 (aws ec2), I can run it in the console but when trying to run as a service it will not start
[19:28:06] <n06> ehershey, i dont have complicated indexes. I have exactly one index outside of the shard key and its a single combined index
[19:28:22] <BrenCom> I have ensured dir permissions and n file locking, not sure how to resolve. can anyone please assist?
[19:30:00] <lazrahl> Can the aggregation framework accept and use hints for index choice?
[19:30:40] <n06> is there a way to trace an insert like the way explain() works for cursors?
[19:30:56] <lazrahl> I see an open jira entry that mentions adding this feature...so I'm guessing no.
[19:35:25] <drag> Hey all. Currently writing a java application that interacts with mongodb. Do I have to synchronize the writes so that threading will be ok or will mongo take care of that for me?
[19:35:54] <n06> drag, the way i did it was to set up all writes to be atomic, that way everything is threadsafe
[19:36:08] <drag> n06, so mongo doesn't do it for me?
[19:36:33] <n06> you would basically just use the update command with the upsert flag
[19:39:12] <BrenCom> have installed mongodb on Ubuntu 12.04 (aws ec2), I can run it in the console but when trying to run as a service it will not start
[19:39:12] <n06> it should work as advertised if thats what you mean
[19:39:34] <n06> well when you install mongodb it starts a service autmoatically so first run sudo service mongodb stop
[19:39:35] <BrenCom> it doesn't unfortunately, have been all over stackoverflow etc and tried everything
[19:40:17] <n06> what flags are you giving mongo when you set it up? like is it a replset or a sharded cluster or something special?
[19:40:23] <drag> n06, so if I create a map<string, object> and give that map to the BasicDbObject contructor, I can just use upsert as the name of one of the keys?
[19:41:05] <n06> drag, upsert isnt the name of a key, its an option within the update command
[19:41:51] <n06> so you would do something like update({/your stuff here/}, {upsert: true})
[19:41:52] <BrenCom> I am scriting new server deployment with RightScale, and am mounting a stripe set. immediately after installation I modify /etc/mongodb.conf to point to the mounted dir (/data/db) then call "sudo service mongodb restart"
[19:42:36] <BrenCom> n06: am not flagging it as anything special yet. just a simple installation
[19:43:25] <n06> hmm im not really sure what your problem is. I do know that when i start a mongod i use the --fork option because all of my instances are part of a replSet
[19:43:33] <n06> maybe that would work better for you?
[19:44:00] <n06> it will run the instance of mongod as a subprocess which means it will run in the background
[19:44:44] <n06> I'm not 100% sure if it makes a difference, if the only reason you're running as a service is to make it headless than i think its the same
[19:44:45] <BrenCom> is there any performance hit in doing it that way? why does the website documentation recommend service start for ubuntu instead of fork?
[19:45:24] <n06> BrenCom, I really couldn't tell you, but it probably has to do with efficiency on a process level
[19:46:08] <drag> n06, okay, I didn't come across this method the mongodb java tutorial. Currently, I create a new MongoClient object and connect with the appropriate options. Then I create a new DBCollection, then I insert using a BasicDBObject created from a map. How would I set the update option in this manner?
[19:46:42] <n06> update() is its own function, i would suggest checking out the java driver documentation
[19:46:58] <BrenCom> thank you n06, I'd like to exhaust all my options. does 10gen provide support on such issues?.
[19:47:17] <n06> BrenCom, couldn't tell you, i dont work for 10gen :) just anothe user
[19:47:35] <BrenCom> I know, just thought you might know :)
[19:51:44] <drag> n06, thanks. Out of curiousity, how do I do interact with the database in the manner you initially stated? There doesn't seem to be a method in collection which accepts a string.
[19:52:11] <n06> drag, not a string, a BasicDBObject
[20:10:55] <drag> n06, another quick question. Say I have a doc out there of: {_id: 1, text: "hi there"} and I want to replace it with {_id: 1, text: "hi there", text2: "you"}, I can use upserts and have it search for {_id: 1} and replace with {_id: 1, text: "hi there", text2: "you"}, correct?
[20:34:40] <Skunkwaffle> Does anyone know of a way to use a $regex inside the predicate of a $cond operation in the aggregation framework?
[20:35:09] <Skunkwaffle> I know you can't just drop it in, but I'm wondering if anyone knows somekind of hack, workaround, or anything else that allows this.
[20:39:17] <Skunkwaffle> What I'm trying to do is count all the documents that contain a specific substring in one field. Which works using {'$sum': {'$cond': [ <predicate> , 1, 0]}}.
[20:39:29] <Skunkwaffle> but when the predicate involves matching against a regex, it doesn't
[20:43:41] <awpti> I'm confused. I'm doing: db.my_collection.find( { field1: val1, field2: val2 } ); with values that do not exist, yet it's returning records that don't match. What's the deal here?
[20:45:40] <Skunkwaffle> I'm counting some other things too so I cant just add it to a $match object earlier on, but I was thinking I could do some kind of $project trick to create a field I could check in the grouping later
[20:55:29] <awpti> http://pastie.org/8107912 for relevance in my above question
[21:11:48] <dnsdds> I'm getting a "Access denied (5)" error while trying to install Mongo as a Windows service. And I am running cmd as an Administrator. What's up?
[21:59:09] <neeky> your issue may be hardware tuning, not mongo
[21:59:56] <neeky> i don't know how big each of your documents is, but 40 million of anything is a lot
[22:33:05] <awpti> I could use some help here -- I feel I'm fundamentally misunderstanding something, but I'll be damned if I can work out what that is: http://pastie.org/8107912 (question is in the pastie with relevant data)