[01:55:58] <stefandxm> toothrot: think of indexes as presorted data. if you have one million random numbers spread out in a file and add constraint number > 3 and number < 1 million it will have to loop through all numbers because there is no order. if you add an index it will be able to jump to 3 and start the loop linear.
[01:56:27] <stefandxm> toothrot: but if you take all of them, ie 0..max it will loop through the same amount of data anyways
[01:57:01] <stefandxm> of course, if you want them sorted, then the index can help, because then it is presorted so no extra sorting is required
[02:05:47] <topwobble> stefandxm: i thought you cant do an index on a range
[02:06:12] <stefandxm> dont think of it as a range
[02:06:23] <topwobble> We use indexes with constraints… just in this example I was not using them to excersise the existense of indexes
[02:06:28] <stefandxm> the range is just because you make constraints
[02:06:49] <stefandxm> but since you are not using constraints, the index will not be used
[02:14:13] <joannac> you can use that index, find the first entry for which foo > 3, continue reading index entries until the one where foo > 1000, and bam, you're done
[02:14:25] <joannac> and you only looked at index entries and documents that match your query
[02:15:08] <topwobble> cool thx. that would be much better ;)
[03:12:40] <d0tn3t> i'm setting up replica mongodb, i set my server1 is Primary but after i use rs.initiate(....) my server1 become SECONDARY
[03:58:55] <Boomtime> joannac has already told you what you need to know
[03:59:13] <Boomtime> the two members of your set cannot talk to each other
[03:59:44] <Boomtime> either an address is wrong, or a port, or one of them isn't running, or a firewall is blocking them, or some other network problem
[04:00:24] <Boomtime> the members of your replica-set cannot see each other, that is all we can know, you must investigate why
[04:01:00] <d0tn3t> ok, tks, i will investigate now
[04:48:53] <joannac> did you need help with something?
[05:00:18] <AlecTaylor> joannac: Yeah, playing around with map reduce to emulate joins
[05:01:58] <AlecTaylor> fooRec = {‘bar’: ‘can’, ‘haz’: ‘foo’}, barRec = {‘foo’,’can’, ‘haz’,’foo’}; - How do I join the first 50 fooRec’s with their corresponding barRec?
[05:02:19] <AlecTaylor> (assuming same schema as above throughout with no nulls)
[05:11:02] <AlecTaylor> joannac: They have equal ‘haz’ values
[05:11:18] <AlecTaylor> fooRec = {‘bar’: ‘can’, ‘id’: ‘foo’}, barRec = {‘foo’,’can’, ‘fid’,’foo’}; - How do I join the first 50 fooRec’s with their corresponding barRec?
[05:50:01] <AlecTaylor> for each orange_id there are multiple pears
[05:51:17] <Boomtime> then the lnked article will not work, it sets the _id of the merge result to a value from the left-hand source, there is no way for the right-hand merge to multiply that by it's own occurrences
[05:52:09] <Boomtime> monogdb does not have joins, you must do at least some of the work on the client, or write a better schema
[05:56:33] <Boomtime> heh, i was about to say that looks like a lot of work, but the author already did:
[05:56:35] <Boomtime> "This technique should definitely not be performed on the fly. It's suited for a cron job or something like that which updates the merged data periodically."
[10:05:48] <cipher__> I'm getting a utf8 decoder failed invalid continuation byte at something the rather from python? I'm trying to load in data from a mongo database, is there a way to repair utf-8 before doing this?
[13:10:23] <tscanausa> can you run repair database on a slave?
[13:21:39] <tscanausa> jordana: I could. I just need to feel up disk space on all of the nodes with out blocking.
[13:21:43] <sfix> hi guys, on the latest build of MongoDB the /var/run/mongodb directory is deleted every time the machine reboots, why's that?
[13:22:02] <tscanausa> because mongo is not running?
[13:23:32] <sfix> tscanausa, that's no reason to delete that directory
[13:24:04] <sfix> it's not created when i try to restart the service
[13:24:22] <jordana> tscanausa, but repairDatabase does block?
[13:25:21] <tscanausa> I dont care about blocking the slaves just not writes to the master. I didnt know if repairDatabase was a master only operation.
[13:25:44] <jordana> tscanausa: no, you can use it on slaves
[13:26:01] <jordana> tscanausa, but you'll need a lot of space to use that method
[13:26:31] <tscanausa> I just emptied all of the collections.
[13:27:39] <jordana> tscanausa: then you should be able to use it. If the database is empty though why don't you just delete the db files?
[13:28:55] <tscanausa> its an analytics cluster where the amount of data get out of hand. I need the indexes to stay around. I used to just drop the entire database, but I cant do that any more.
[13:29:16] <tscanausa> jordana: if you have a recommendation let me know
[13:32:58] <jordana> tscanausa: interesting, how big is the db?
[13:43:23] <sfix> so to ask again, is there any reason why MongoDB no longer creates /var/run/mongod when started?
[15:29:06] <jasondockers> I'm using mongo::bsonobjbuilder with std::strings of header and body info from emails. It inserts and looks correct in mongodb, yet python is giving me errors that indicates it's invalid utf8- doesn't the mongo driver ensure it's utf8 encoded, or it can't be inserted?
[15:39:10] <sebastian_o|> hi guys, after upating/upgrading via breew, mongd command doesn't start mongodb anymore here. Any hint in how to get it loading the .conf again?
[15:55:39] <jasondockers> Can I fix utf-8 encoded improperly in mongo documents?
[16:13:17] <kees_> using PHP, what could be the reason for this behaviour?; I'm storing an integer (confirmed with var_dump just before i do save()), but when i retrieve that value i get a float
[16:13:43] <Derick> kees_: how large is the integer?
[16:13:50] <Derick> and, which driver version are you using?
[16:22:29] <kees_> not yet.. if i use the very basics it works, if i use our entire codestack it doesn't :/
[16:22:46] <Derick> :-) That's what I'd figured :)
[16:23:18] <kees_> only started doing that when i upgraded it from php 5.3 to 5.5
[16:25:06] <kees_> and ofc it only happens in production
[16:26:33] <Derick> not sure what advice I can give
[16:39:19] <kees_> well, it isn't a known bug at least :)
[16:41:38] <hubertus> Hi Everyone. I have a question regarding an aggregate problem. I basically have a collection which stores impressions of an article by a visitor. I want to get some stats for a certain article. I have a writeup of my problem here: http://paste.ofcode.org/a6J3Ni4cEbgFWFWCLneJRM Could someone assist me with the question at the end?
[16:50:32] <blizzow> I have a db(mydb) with a few collections within it. The collections are named A,B,C,D... From the mongo shell, how would I remove a specific collection? Say C. I already logged in and did: use mydb. but I'm mildly stumped from there. The db.collection.drop documentation says it takes no arguments and I don't want to drop A,B, or D.
[17:49:45] <hubertus> Hi Everyone. I have a question regarding an aggregate problem. I basically have a collection which stores impressions of an article by a visitor. I want to get some stats for a certain article. I have a writeup of my problem here: http://paste.ofcode.org/a6J3Ni4cEbgFWFWCLneJRM basically what I want is to group and count distinct.
[17:50:10] <kees_> Hmpf. got to love the fact how random this is and i still haven't figured it out.. tcpdump shows me inserting a Int64(0x12)46943, and when i query it is get a Double(0x01)46942.. but not always
[19:38:19] <whaley> JonSno: or use one of the api clients if you need to do it programmatically
[19:39:16] <JonSno> currently I have a wordpress site that generates a 124k json file of all posts and pages. I will then import into mongodb
[19:39:33] <dberry> mongodb config server question: I have mongo1,mongo2,mongo3 as my config servers. If I use host files can I change the name to mongo{1,2,3}-cfg (same IP) and restart mongos?
[19:40:22] <JonSno> whaley: that would be my next question, is their a mongodb api for php
[19:50:10] <Zelest> then I'm clueless.. was hoping you were using ruby :P
[19:50:33] <meonkeys> a = new ISODate(); b = a; // but a === b is false. Why?
[19:50:53] <meonkeys> whoops, my bad, they are equal.
[19:51:19] <Zelest> jasondockers, string.chars.select{|i| i.valid_encoding?}.join.strip .. if you were using ruby.. can't you do something similar in c++?
[19:51:22] <SkramX> in an aggregate query's project, how do i reach into an array and get just the first item?
[19:53:58] <svinay> hi! In our mongo logs, we see a lot of entries like "insert <our_db_name>.system.indexes keyUpdates:0 locks(micros) w:93" ... does it mean that an index rebuild happened at that instant?
[19:55:05] <svinay> too many such entries, around 1000 such entries in a time span of 50 mins, for a minimal load of around 1000 connections at the max
[19:57:35] <SkramX> i have an array of [lat, lon] - is it possible to index that?
[20:00:21] <meonkeys> (FYI, related to my earlier question: http://stackoverflow.com/questions/25434872/why-are-two-equivalent-isodate-values-not-equal )
[20:16:24] <cheeser> insert with a unique constraint?
[20:43:03] <SkramX> how can i ensure an index is being used for a specific aggregate function?
[21:04:44] <cheeser> you can do an explain to check.
[21:17:07] <ngl> Hi all. I'm doing some research and wanting to make an alert system of sorts. I don't mean on mongo metrics, but a simple example would be: A user is expected to log in by a specific time. But, that user failed to login... send alert.
[21:19:17] <ngl> I can use that to send, but can I watch a value within mongo and cause some event... hmm.
[21:21:27] <ngl> I was just trying to utilize mongo, but maybe my idea isn't going to work. I didn't want to keep... ah, I can keep just the next expected "login" in memory and when that is reached I'll do alert and grab the next from mongo.