PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 21st of April, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:36:27] <digitalextremist> Anyone know why the README for mongo-ruby-driver shows Mongo::Client and everywhere else in the Wiki I see MongoClient ?
[01:41:31] <Mark_> dunno, but i found a lot of inconsistencies in docs here and there vs php docs
[01:41:35] <Mark_> old examples, etc
[01:41:40] <Mark_> im guessing that things have changed over the years
[01:49:38] <digitalextremist> Mark_: the driver seems to be radically out of sync with the Wiki. I suppose I’ll post an issue if one hasn’t been made already
[01:50:07] <digitalextremist> … except there is no issue tracker. Sweet!
[01:50:18] <Mark_> since i was just playing it wasnt a big concern for me, i was just playing converting some nosql friendly stuff to mongo
[01:51:17] <digitalextremist> I have mongodb running in production and the latest gem was a breaking change in many areas :-/
[01:58:53] <Mark_> ahh
[01:58:56] <Mark_> i just banged this out for fun
[01:58:57] <Mark_> http://npa.herokuapp.com/?n=2025521555
[01:59:09] <Mark_> i havent used mongo for much before, was just seeing what i could shim into it
[03:18:46] <george2> My db has been working on the single command "db.data.remove({text: {$exists: false}})" for over 9 hours now. :/
[03:19:30] <george2> I mean, I have a few hundred million records, but advanced queries usually still only take a couple hours.
[03:19:48] <cheeser> do you have an index on that field?
[03:20:04] <george2> argh, I didn't think of that
[03:20:06] <cheeser> :)
[03:20:39] <george2> how significant is the time reduction if you create an index first?
[03:20:46] <george2> usually a lot?
[03:21:26] <george2> just wondering if I should stop it now, create an index and restart, or just let it finish
[03:24:40] <cheeser> i would expect a lot, yeah.
[03:25:00] <cheeser> although indexing might take as long as deleting. but it you need that index long term, it'd be worth it.
[03:25:07] <george2> wish there was some way to see where it was...
[03:25:24] <george2> well I'm deleting probably well over 90% of my data
[03:25:46] <george2> and this isn't something I expect to ever have to do again
[03:26:17] <george2> guess I'll just leave it then. thanks :)
[03:26:19] <cheeser> well, you could issue a killOp command on it. get the count on that collection, and try again.
[03:26:31] <george2> killOp?
[03:26:50] <cheeser> http://docs.mongodb.org/manual/reference/method/db.killOp/
[03:27:31] <george2> Hm. I tried a findOne earlier though, and it still returned the first record.
[03:27:42] <cheeser> why wouldn't it?
[03:27:53] <george2> I thought maybe it found all matching records first, then started removing them, or something like that.
[03:28:13] <george2> well, by first I mean the original first
[03:28:41] <george2> I'm deleting all my old records, so I would expect at some point a findOne would return one of the new ones, with 'text'
[05:32:25] <NaN> hi there
[05:40:20] <NaN> (fedora 19) I created the .repo file and when I try to install it it says "No package mongodb-org available." is there any extra step to install it with yum?
[05:41:48] <ranman> NaN: what steps did you follow?
[05:42:08] <ranman> NaN: did you previously have the mongodb-10gen packages installed?
[05:42:40] <NaN> ranman: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/
[05:43:01] <weeb1e> Hi everyone, my mongodb is freaking out, is there a faster way to clear a whole collection than .delete()?
[05:43:14] <NaN> ranman: no, it's a clean install
[05:43:15] <ranman> weeb1e: .drop() ?
[05:43:32] <weeb1e> Sorry, I meant than .remove()
[05:43:36] <ranman> NaN: did you yum update ?
[05:43:48] <ranman> weeb1e: there is a dropcollection
[05:44:13] <weeb1e> Ok, .drop() worked
[05:44:20] <weeb1e> There goes a months worth of data :|
[05:44:24] <NaN> ranman: yes, but it seems there's no mongo repo
[05:44:45] <weeb1e> It does seem to have fixed the problem
[05:44:46] <ranman> aha! I think the DIR might be wrong for certain versions of fedora
[05:44:54] <ranman> weeb1e: what was the problem?
[05:45:04] <weeb1e> Mongodb was using a crazy amount of resources and making all other databases insanely slow
[05:45:24] <ranman> if you're going to run multiple databases on one machine look into something like cgroups
[05:45:28] <weeb1e> I couldn't just delete some of the documents, since it took half a day to delete only a million or so
[05:45:35] <weeb1e> There were over a billion documents in the collection
[05:45:39] <ranman> the software has no way of knowing that it's sharing resources with other databases
[05:46:00] <weeb1e> ranman: This was after I had shutdown all software using that database
[05:46:23] <ranman> weeb1e: right, it's designed to keep things in memory
[05:46:25] <weeb1e> Mongodb was killing performance due to the collection size, even with nothing touching the database it was using
[05:46:38] <weeb1e> It said 64GB ram used
[05:46:40] <NaN> ranman: the .repo file is on the same dir as the other repos
[05:47:05] <weeb1e> Though top did not say all applications were using 64GB, so I can't say exactly how much ram mongo was using
[05:47:14] <ranman> weeb1e: you have 64GB of ram on that machine ? or did it just say 64GB of virtual RAM also, it should have been paged out by your operating system if the other databases
[05:47:23] <weeb1e> The box has 128GB ram
[05:47:43] <weeb1e> It said 64GB physical ram, not virtual memory which is always hopelessly wrong
[05:47:43] <ranman> weeb1e: then mongod was not what was killing the performance if it was only taking up 64gb...
[05:47:52] <weeb1e> It wasn't killing the machine
[05:47:57] <weeb1e> It was killing its own performance
[05:48:02] <ranman> ???
[05:48:04] <weeb1e> The machine shrugged it off
[05:48:19] <weeb1e> All applications accessing other databases were experiencing insane query times
[05:48:29] <ranman> I no longer understand what you're saying, hop in a PM if you'd like more help but what you're saying doesn't make a lot of sense to me sorry
[05:48:29] <weeb1e> Even with nothing touching the large collections database
[05:48:41] <ranman> oh
[05:48:44] <ranman> wow
[05:48:49] <ranman> I've misunderstood you :D
[05:48:59] <weeb1e> Sorry if I was not clear
[05:49:04] <ranman> I thought you meant you were running multiple databases on one machine as in postgresql, mongodb, etc.
[05:49:12] <ranman> but you just meant different mongodb databases
[05:49:17] <ranman> haha, ok, cool
[05:49:22] <weeb1e> I now know I cannot store that much data in mongdb in a useful way, and have to rethink things
[05:49:43] <weeb1e> Yeah it was just a mongo issue
[05:49:48] <ranman> so the next time something like that happens try to spin up mongoperf or run db.currentOp() to ascertain what exactly is taking up all that time
[05:50:01] <weeb1e> But I have a bunch of services that use mongo, and rely on a fast query time, so after a day it became very noticable
[05:50:03] <ranman> there's also a --slowqueries option that will log queries that take above a certain threshold
[05:50:29] <ranman> weeb1e: understood sorry that happened, if you still have the logs you can definitely get a better understanding of what was happening
[05:50:48] <ranman> NaN: is there an issue with the mongodb.repo file do you think?
[05:50:52] <weeb1e> Ok, once I rework this projects storage, I will pay better attention to performance once it is running again
[05:51:03] <ranman> NaN: I was just able to do this on a test box
[05:51:06] <NaN> ranman: yum clean all did the trick, it was a yum problem
[05:51:09] <ranman> ok
[05:51:11] <ranman> sweet
[05:51:15] <NaN> thanks ranman :)
[05:51:24] <weeb1e> I always knew I needed to change that collection, but by the time I got to it, it was already too large to migrate the data
[05:51:28] <ranman> NaN: just your friendly neighborhood nightowl
[05:52:08] <weeb1e> I feel a column store would be much better suited for stats storage, but when I tested putting some of the data into postgres, it used even more disk space than mongos millions of documents
[05:52:16] <ranman> weeb1e: yikes :/ that's rough. there really a lot of options you have to prevent stuff like that
[05:52:38] <ranman> weeb1e: event data (non-entity data) like stats is particularly well suited to document stores like mongodb IMO
[05:52:48] <NaN> weeb1e: are planing to use mongo again, for the same project?
[05:52:53] <ranman> and I like postgres just fine too :D
[05:53:06] <weeb1e> NaN: Yes, since I don't know of something else that can store the data more efficiently
[05:53:54] <weeb1e> I have a few integers that need to be recorded for ~20k servers every ~10 seconds
[05:54:12] <ranman> weeb1e: There's a really great presentation that mongodb has called Real Time Analytics With Bucketing by scott hernandez
[05:54:24] <ranman> *bucketing and pre-aggregation
[05:54:32] <NaN> wow
[05:54:43] <ranman> I would check that out
[05:54:48] <ranman> I am trying to find a link to it
[05:54:52] <NaN> youtube?
[05:54:58] <ranman> but this presentation search on mongodb's website sucks.
[05:55:03] <weeb1e> I'll take a look at that, thanks
[05:55:37] <NaN> mongo with node I suppose, to make it real time, isn't?
[05:55:43] <weeb1e> My application queries ~20k servers and records integers representing server number, client count, ping and timestamp
[05:56:33] <ranman> weeb1e: is it the right load that it can't handle?
[05:56:38] <weeb1e> The web backend application then renders graphs for the data on the web front end, and also receives realtime updates from the query backend
[05:57:02] <weeb1e> ranman: It's just storing the amount of accumulated data
[05:57:08] <ranman> s/right/write
[05:57:15] <weeb1e> It adds up fast, and performance drops
[05:57:25] <weeb1e> Short term, the load is no issue at all
[05:57:32] <ranman> you might want to consider serving the reads from a replicaset member
[05:57:41] <weeb1e> Reading is also no issue
[05:57:47] <weeb1e> If it ever had to become one, I would do that
[05:58:19] <weeb1e> I feel that such small amounts of stats data is not really a good fit for mongo documents though
[05:58:38] <weeb1e> Because the keys and bson data will use up a lot more space than the actual data
[05:58:44] <ranman> weeb1e: if you go to mongodb world there's a talk about something similar on the scale of 4GB I think it's called weathermen or something
[05:58:58] <ranman> weeb1e: are you using shortnames for the keys?
[05:59:06] <ranman> s/4GB/4TB
[05:59:07] <weeb1e> I'm using single chars
[05:59:14] <ranman> :/
[05:59:58] <weeb1e> Again, when all I need to store is 4x integers, the keys will still use more space than the data, and the _id will use more than everything put together?
[06:02:18] <ranman> that's why I think you should look into bucketing, larger documents by minute / hour / etc.
[06:02:37] <weeb1e> Yeah, that is what I'm planning on doing anyway
[06:02:45] <weeb1e> But I still want as much detail as possible
[06:02:55] <weeb1e> Since I allow zooming into graphed periods of data
[06:02:58] <ranman> weeb1e: you can do that without loosing any granularity at all
[06:03:48] <weeb1e> Yeah that's true, though it still will end up using a lot of disk space, and at some point mongo performance will become an issue again
[06:04:02] <weeb1e> So I need to decide how much granularity will be sustainable
[06:05:17] <ranman> weeb1e: I think this might help? not sure: http://docs.mongodb.org/ecosystem/use-cases/pre-aggregated-reports/
[06:06:50] <weeb1e> That sounds like it's on the right track, I will read through it when I have time
[06:07:24] <the8thbit> Hello
[06:07:35] <the8thbit> I'm trying the query: Badge.find( { owners: { $in: [{ username: req.query.username }] } } )
[06:07:52] <the8thbit> where owners is an array of subdocuments containing a username and a date field
[06:08:22] <the8thbit> I'm trying to look for an entry in the subdocument array with a username equal to req.query.username
[06:08:39] <the8thbit> however, I alway get an empty array as a result
[06:08:57] <the8thbit> where am I going awry?
[06:14:55] <ranman> the8thbit: so you only have one username?
[06:15:00] <joannac> you want "owners.username": {$in: req.query.username}
[06:15:00] <ranman> in the request object?
[06:15:32] <the8thbit> joannac: Even though owners is an array?
[06:15:44] <the8thbit> I dont have to do anything special?
[06:15:48] <ranman> because then you could just do: Badge.find({"owners.username": req.query.username})
[06:15:54] <joannac> as long as req.query.username is one single username, yes
[06:16:01] <joannac> get rid of the $in in that case
[06:16:13] <the8thbit> aw damn, cool
[06:16:15] <joannac> is req.query.username is actually an array of usernames, do it the way I had it
[06:16:19] <the8thbit> thats so simple and elegant
[06:16:24] <joannac> also hi ranman
[06:16:24] <ranman> the8thbit: from the query's perspective you can think of all arrays of documents as being unrolled
[06:16:28] <ranman> joannac: hi there :D
[06:16:40] <the8thbit> ranman: Cool, I will :)
[06:17:01] <the8thbit> I have to get my database guy to actually learn mongo
[07:23:51] <Diplomat> guys
[07:24:30] <Diplomat> is it possible to have like.. 3 read servers and 2 write servers.. like i write into 2 servers and 3 servers will have consistent data
[07:25:24] <Diplomat> so 3 servers will be optimized for reading (SSD etc) and 2 servers are optimized for receiving data and then sending that data into read servers for access
[07:55:42] <lkthomas> hey guys
[07:55:46] <lkthomas> anyone still alive ?
[07:56:18] <lkthomas> > db.runCommand({cloneCollectionAsCapped:log_lines, toCollection:log_lines_cloned, size:2147483648} )
[07:56:21] <lkthomas> Mon Apr 21 15:55:42 ReferenceError: log_lines is not defined (shell):1
[07:56:21] <lkthomas> anyone have idea why ?
[08:14:43] <kali> lkthomas: double quotes around "log_lines"
[08:15:26] <kali> Diplomat: you can have one "write" server (the primary node in a replica set) and use the other to performs reads
[08:15:57] <kali> Diplomat: to have two "write" server, you need to shard, and in that case every node get only half of the data
[08:16:25] <Zelest> kali, as for my pull and push within the same query, that's not possible.. but nothing stops me from adding the new url first and remove all the old ones afterwards :D
[08:16:30] <lkthomas> it works, thanks. After clone the disk usage didn't change much
[08:16:39] <lkthomas> kali: should I look at storageSize or size itself ?
[08:17:37] <kali> lkthomas: http://docs.mongodb.org/manual/faq/storage/
[08:17:46] <kali> Zelest: good
[08:22:21] <lkthomas> kali: is it possible to copy existing index table and copy it to new one ?
[08:22:29] <lkthomas> kali: I see no index on cloned collection
[08:23:45] <lkthomas> db.collection.getIndexes()
[08:23:47] <lkthomas> correct ?
[08:24:08] <kali> yes. i think you need to do it by hand
[08:24:25] <kali> mongodup/mongorestore would maintain indexes if that's an option for you
[08:24:52] <lkthomas> wait, I mean, I already cloned as capped collection
[08:25:00] <lkthomas> does mongodup could create index for me ?
[08:26:40] <kali> without dealing with the data ? i don't know :)
[08:27:20] <lkthomas> OK, so how could I insert index once I got getindexes() from old collection ?
[08:27:36] <lkthomas> I got v, key, ns and name object
[08:27:46] <lkthomas> there is 6 of them
[08:28:48] <kali> well, you already know the ns, you should not mess with the "v", and the name is usually generated ok. so you only need to call createIndex with the key
[08:39:15] <Diplomat> @Kali: well it's okay if it gets half of the data.. as long as it writes fast and stores info so i can use processor to process that data and store it in read only server
[08:39:26] <Diplomat> I was thinking about using Cassandra for writing and MongoDB for reading
[08:40:44] <kali> have you got serious reason to think one or the other is not able to do both ?
[08:40:56] <kali> one database is complicated enough...
[08:41:36] <Diplomat> well i need to be able to write raw data into write server even when read server for queue is down
[08:42:35] <Diplomat> I'd need to have it like MongoDb (read only) -> Queue -> Raw processor -> Cassandra -> Processor -> MongoDb
[08:43:21] <kali> oO
[08:43:41] <Diplomat> So when MongoDb is down I still have queue which servers as like a little buffer between mongo and raw processor
[08:44:57] <Diplomat> because mongodb storage is most important part of the system and when it goes down I can use cassandra's data as until mongo is up again
[08:45:08] <lkthomas> kali: hang on now
[08:45:31] <lkthomas> kali: I just want to clone as capped collection and switch uncapped to cap
[08:46:52] <lkthomas> do I still need to recreate the index ?
[08:47:13] <Diplomat> hmm i could use mongodb really.. but i'd need it to be consistent at all the times
[08:49:27] <lkthomas> interesting
[08:49:37] <lkthomas> when I try to renameCollection, access denied
[08:49:50] <lkthomas> wait
[08:49:54] <lkthomas> looks like my command have problem
[08:50:08] <lkthomas> same problem
[09:08:11] <lkthomas> kali: you there ?
[09:12:17] <dragoonis> If I have a mongodb collection in production, and I want to run a background job to clear out that collection and update it with new results. What's a suggested technique for going about this to ensure there's no loss of services between when swapping the live collection with the newly generated collection
[09:12:25] <dragoonis> loss of service*
[09:14:27] <lkthomas> Wow
[10:26:02] <dragoonis> Derick, does the php extension for MongoDB support db.collection.copyTo()? I'm not seeing this in: http://www.php.net/manual/en/class.mongocollection.php
[10:52:42] <G1eb> anyone else doing the mongo university here?
[10:54:22] <Diplomat> guys, is there a way to update like 1000 rows at once ?
[11:00:08] <G1eb> yes
[11:08:48] <boll> has anyone had any experience using any of the unauthorized php drivers with hhvm and mongodb?
[12:10:14] <Diplomat> my update query is super slow :/
[12:10:20] <Diplomat> 100 updates takes like few seconds
[12:15:45] <cheeser> have you indexed properly?
[12:15:51] <kali> Diplomat: is there an index on your update selector ? what write concern are you using ?
[12:39:56] <Diplomat> yes all indexes are fine i dont see anything in logs
[12:40:03] <Diplomat> but i have no idea what is "write concern" lol
[12:42:16] <dragoonis> Diplomat, http://docs.mongodb.org/manual/core/write-concern/
[12:49:23] <asturel_> is there a way to measure execute time of a query in mongodb?
[12:49:35] <asturel_> i mean without creating e.g. date obj or something like that..
[12:49:55] <asturel_> explain?
[12:54:28] <Nodex> in your script - simple :)
[13:02:11] <Randy_> I'm using casbah mongodb scala driver
[13:03:03] <Randy_> I have a document like this
[13:03:05] <Randy_> {
[13:03:06] <Randy_> "_id" : ObjectId("5354f3c2e4b0c74940aabf7a"),
[13:03:08] <Randy_> "allAppDetailsId" : ObjectId("5354f3c2e4b0c74940aabf77"),
[13:03:09] <Randy_> "name" : "Shawn",
[13:03:11] <Randy_> "updates" : [
[13:03:12] <Randy_> ObjectId("5354f3c2e4b0c74940aabf88")
[13:03:14] <Randy_> ]
[13:03:15] <Randy_> }
[13:03:27] <Randy_> i want to add one more record in updates array
[13:03:29] <Randy_> how can i do it
[13:24:35] <cheeser> for starters by waiting longer that 5 minutes for an answer on irc.
[13:31:16] <Nodex> haha
[13:33:45] <cheeser> everywhere threads unblock...
[13:47:22] <G1eb> what is the correct definition of a collection scan?
[13:47:47] <G1eb> I thought it was the same as a table scan in relational but that turns out to be false
[13:54:57] <Nodex> in what sense?
[13:58:49] <saml> G1eb, collection scan is when you scan a collection. by map reduce probably
[13:58:58] <saml> or collection.find()
[13:59:13] <saml> oh never mind
[13:59:28] <saml> it means when you did .find() or something, it didn't use index
[14:00:00] <saml> http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption--notablescan
[14:00:41] <saml> you start mongod with --notablescan and you are certain performance is good because you are forced to ensure proper index
[14:00:44] <tscanausa> does map reduce work on secondaries in a replica set?
[14:01:20] <saml> tscanausa, in mongo shell? or in driver?
[14:01:33] <saml> if you use mongo client to connect to replica set, it should be transparent, i think
[14:01:36] <saml> but not 100% sure
[14:02:56] <tscanausa> so I have secondary preferred through my client, but load / ram has jumped 4x on the primary then the secondaries.
[14:15:55] <G1eb> saml, so if you do a find and mongo hits an index it is not considered a collection scan? (since it does not scan the whole collection)
[14:16:16] <saml> G1eb, from my understanding, yes.
[14:16:32] <saml> G1eb, what's the context? why do you want to know?
[14:16:44] <G1eb> ah I get it now, it is except for probably the case when mongo only hits the index when specified in the sort
[14:17:08] <G1eb> yeh, it was a mongo homework assignment, collection scan was true
[14:17:41] <G1eb> I figured anytime it hits the index its not a collection scan but clearly its only the case when it uses find
[14:18:24] <saml> what school gives you mongodb homework?
[14:18:32] <saml> quit that school unless it's free
[14:18:44] <tinco> lol
[14:20:51] <G1eb> haha :)
[14:21:03] <G1eb> https://university.mongodb.com/courses/10gen/M101JS/2014_June/about
[14:21:05] <tinco> doesn't sound to bad, it's good to learn about document stores
[14:21:34] <tinco> though I'm not sure mongodb is the best document store out there for learning fundamentals
[14:22:03] <tinco> it doesn't even do xpath queries
[14:23:13] <tinco> oh wow there's a company that sells an xquery frontend for document stores
[14:23:22] <tinco> that's so cool.. now I'm jealous
[14:24:20] <Nodex> lol
[14:25:29] <Nodex> when do you need xpath inside a document store?
[14:25:53] <tinco> when your data is absolutely fabulous
[14:25:58] <Nodex> or not
[14:26:00] <tinco> :P
[14:26:24] <Nodex> I've been using mongodb for about 4 years and I have NEVER needed xpath
[14:26:59] <tinco> it's probably because your data is all denormalized
[14:27:12] <Nodex> and why would you want it any other way?
[14:27:27] <tinco> a proper document store allows you to store your entire database in a single document
[14:27:33] <Nodex> mongodb is not and does not claim to be a drop in replacement for an RDBMS
[14:27:38] <tinco> I know
[14:27:45] <tinco> I'm not saying you should
[14:28:11] <Nodex> and how does this "one document" approach scale properly?
[14:28:16] <tinco> I'm just saying there's cases where relational data and a powerful query language are pretty awesome
[14:28:31] <tinco> it just does, by some very cool computer science
[14:28:41] <Nodex> I've not come across this "case" yet
[14:30:21] <tinco> cool example, xquery lets you query DAG's in a single query without much of a performance issue
[14:31:54] <Nodex> isn't that what a graphing DB is dor?
[14:31:55] <Nodex> for*
[14:35:07] <tinco> well you could use a graph database of course, but your graph database is just an abstraction over a column store, just like a document store is
[14:35:49] <Nodex> I personaly prefer to use the right tool for the job
[14:36:31] <tinco> how sane of you :)
[14:37:20] <Nodex> evidently
[14:37:29] <Nodex> anyway, enough trolling, I have work to do
[14:39:52] <Diplomat> does anybody have experience with hypertable ?
[14:46:25] <gskill934> is mongodb the right choice to store FIX messages?
[14:52:20] <Nodex> FIX messages?
[14:52:21] <tscanausa> fix?
[14:52:30] <kali> trading protocol
[14:52:38] <kali> according to wikipedia :)
[14:53:07] <kali> not sure mongodb is "the" right choice
[14:54:12] <Nodex> yer, sounds like transactions are probably needed LOL
[14:54:20] <Nodex> and high consistency
[14:54:40] <gskill934> yes, fix protocol
[14:54:48] <gskill934> FIX messages are hirarchical
[14:54:52] <gskill934> have e.g. repeating groups
[14:55:18] <gskill934> so, i thought a JSON format like mongodb have is better than a 2 dimenational table
[14:55:47] <boutell> Thinking about storing permissions in mongodb. Right now I have arrays holding the ids of people and groups who can, let’s say, edit a specific thing: editPersonIds and editGroupIds. By indexing these fields I can efficiently find out if Bob can edit something (in his own right or via a group he’s in).
[14:56:28] <boutell> but I’d like to generalize to more permissions, and I’m wondering if I can efficiently index it still. For instance, there might be “view”, “contribute” and “edit” permissions, and more later.
[14:57:03] <boutell> one possibility is a single array in which the values include both an id and a prefix indicating the permission, like this: permissions = [ ‘edit-57’, ‘contribute-42’ ]
[14:57:55] <boutell> I wonder if I can index a two-dimensional array instead though. permissions[‘edit’] = [ ’57’, ’92’ ]
[14:59:42] <boutell> I suspect my one-dimensional array is the best that can be done here.
[15:04:41] <tscanausa> I guess map reduc eonly works on the master which is different from what that docs say
[15:11:05] <Nodex> boutell : I store permissions in a 1 dimensional array
[15:11:11] <Nodex> works perfectly
[15:11:28] <boutell> Nodex: does it work like I’m suggesting, with the permission name and the id of the individual permitted to do it?
[15:11:47] <boutell> hmm
[15:16:41] <Nodex> I store a registry with a hmac of the file or whatever and a list of attributes associated with it
[16:14:02] <Mick271> helloy guys, anyone knows if statup script exists to run mongos/config server off the distro's packages
[16:14:09] <Mick271> namely amazonlinux or ubuntu
[16:14:34] <Mick271> startup*
[16:31:08] <no_mind> I am using flask with mongoengine. I have a date input field that is mapped as DateTimeField in the model. When I try to validate the form, I consistently get an error "Not a valid datetime value" . How do I fix it ? The date is sent from the browser in Y-m-d format
[17:56:43] <proteneer> https://aws.amazon.com/marketplace/pp/B00CO7AVMY/ <-- do these AMIs support SSL?
[18:17:47] <ehershey> proteneer: no
[18:18:06] <proteneer> so i'd need to build mongo from source to support SSL
[18:18:55] <ehershey> pretty much
[18:19:01] <ehershey> or buy the enterprise build
[18:19:19] <proteneer> we're poor
[18:19:23] <proteneer> so i guess i'll just build it
[18:20:08] <ehershey> it should be pretty easy
[18:20:32] <ehershey> scons --ssl all
[19:19:47] <travisgriggs> all of a sudden, pymongo.MongoClient.database_names() has quit working. it’s failing in createPrivateMap on a file that hasn’t been written to in months (don’t use that db anymore, just haven’t cleaned it out yet). any suggestions? I have zero mongo admin experience. til now, i only had to apt-get install it and it’s just worked wonderful. i *am* on a 32bit box (i know i need to switch to 64 bit some day), but i should be way below memory
[19:19:51] <travisgriggs> issues, i think
[19:24:41] <Zelest> ugh, anyone happen to know when 2.6 is ported to FreeBSD? :o
[19:38:37] <travisgriggs> a reboot of my box doesn’t fix the error. any help much appreciated. is there a better place to ask these questions?
[19:42:05] <Joeskyyy> travisgriggs: Only time I've ever seen that kind of error is when your resources are being overutilized
[19:44:13] <Joeskyyy> What's your free -m look like?
[19:48:16] <Odin^^> Hi guys.. Anyone here ? I’m having some strange issues with mongo. Doing a query on two fields, one string and one collection. If I do either ones I get the right data, if I do them together I get 1/10th of results. And when I hint the query it uses some random index nothing to do with the query.
[19:49:12] <Joeskyyy> Wat
[19:49:21] <Joeskyyy> Have any pastes of examples?
[19:49:39] <Odin^^> Sure. So I do this query: {"album" : "241052846483_1073741867","profilesRelation" : 1619}
[19:49:52] <Odin^^> I have an index set for this query.
[19:50:04] <Odin^^> I only get one result instead of 12.
[19:50:18] <Joeskyyy> can you pastebin an example document?
[19:51:13] <Odin^^> https://gist.github.com/spinx/a8ddfacab27a50678337
[19:51:50] <Odin^^> If I do album, or profilesRelation seperately it works
[19:51:59] <Odin^^> I did reindex, didn’t help
[19:52:07] <Odin^^> repaired db, didn’t help
[19:52:08] <cheeser> do you mean to $and or $or those values?
[19:52:12] <Joeskyyy> ^
[19:52:13] <Joeskyyy> this
[19:52:20] <cheeser> how many have *both* those values?
[19:53:26] <Odin^^> Only 12 values for album. And 1.6k for profilesRelation.
[19:53:58] <Joeskyyy> try db.coll.find({$and: [{"album" : "241052846483_1073741867"},{"profilesRelation" : 1619}]})
[19:54:06] <cheeser> look at those 12 and see how many have 1619 in their profilesRelation
[19:54:20] <cheeser> Joeskyyy: the default is $and
[19:54:27] <Joeskyyy> aw hell, it is
[19:54:56] <Odin^^> @cheeser : 12, all of them
[19:56:56] <Odin^^> @Joeskyyy $and works
[19:57:15] <Joeskyyy> wat
[19:57:20] <Odin^^> actually ..
[19:57:24] <Odin^^> it’s all works now
[19:57:24] <Joeskyyy> lol your first one should be the same result
[19:57:26] <Odin^^> FFS
[19:57:27] <Joeskyyy> o_o
[19:57:38] <Joeskyyy> magic? :D
[19:57:40] <Odin^^> Something is wrong with mongo indexing
[19:58:21] <cheeser> Odin^^: i doubt that.
[20:01:30] <Odin^^> @cheeser explain this then http://bit.ly/1msEv5C
[20:03:46] <cheeser> Odin^^: you switch between profilesRelation and profilePublish for one...
[20:03:54] <Odin^^> they are the same
[20:04:00] <Odin^^> have the same values
[20:04:17] <cheeser> use the same query values then
[20:07:42] <Odin^^> ok, it’s an index updated when documents change ?
[20:08:09] <cheeser> yes, indexes are updated when documents change.
[20:11:42] <Odin^^> Ok either this is not working or i’m a fucking retard. If i’ll need help can someone here do that for $$ ofcourse ? Needs some way of identifying bcz I have a client production server that I need give access to.
[20:30:08] <Odin^^> Does index creation sequence has anything to do with how indexes are slected when you query ?
[20:30:37] <cheeser> the order the indexes are created? or the order in which the fields are listed in an index?
[20:30:45] <Odin^^> created
[20:31:29] <cheeser> yes. the order they appear in the query should match the order they appear in the index
[20:33:18] <Odin^^_> missed that if you answered .. I guess it does not
[20:33:48] <cheeser> why would you assume that?
[20:33:51] <cheeser> http://irclogger.com/.mongodb/2014-04-21
[20:34:07] <skot> The order of fields in the query in no way affects which index is selected.
[20:34:27] <skot> You can order the fields in the query in whatever order you want and it will use the same indexes.
[20:34:29] <cheeser> no? i've been told otherwise but that's good to know for sure.
[20:34:52] <cheeser> either way, explain is your friend
[20:34:53] <skot> If you have the query {a:1, b:1} it is the same as {b:1, a:1}
[20:34:54] <Odin^^_> because it choses the wrong index
[20:35:52] <skot> Depending on the selectivity of the index you can get different indexes used and for different values in your query as well.
[20:36:55] <skot> It may turn out that {a:1, b:3} is better for an index with of b, than {b:1, a:10} is for an index of a
[20:37:14] <skot> It totally depends on which are tested by the query planner and picked (then cached).
[20:37:15] <Odin^^> ok, maybe I have too many indexes?
[20:37:39] <skot> It is best to run explain to see what index is used
[20:37:53] <skot> (and how)
[20:38:14] <Odin^^> I did exactly that and the wrong index is used
[20:38:31] <Odin^^> actually one that has little to do with the query given
[20:38:39] <Odin^^> and it returns no results
[20:38:41] <skot> cheeser, the query plans are cached by canonical query, so the fields are basically reorded anywya.
[20:38:51] <skot> Can you post the explains?
[20:39:24] <skot> and include the server version info and indexes as well?
[20:41:19] <cheeser> skot: i was wondering about that. makes sense.
[20:41:46] <Odin^^> https://gist.github.com/spinx/53499a4974373214da1c
[20:42:08] <Odin^^> MongoDB shell version: 2.4.6
[20:42:59] <Odin^^> https://gist.github.com/spinx/10d27fa4f0224badb539
[20:44:09] <skot> what does db.version() show?
[20:44:49] <Odin^^> same
[20:44:54] <Odin^^> 2.4.6
[20:46:06] <skot> What index should it be using??
[20:47:02] <Odin^^> the one that it chose in this instance
[20:47:05] <Odin^^> albumsforprofile
[20:47:24] <Odin^^> this is messed up
[20:47:25] <Odin^^> https://dl.dropboxusercontent.com/u/6875944/Screen%20Shot%202014-04-21%20at%2022.45.59.png
[20:47:42] <Odin^^> it’s not returing data, but count does work
[20:47:47] <Odin^^> and is correct
[20:49:31] <skot> And there is no data changing? This is not a live system with users?
[20:51:26] <Odin^^> It is, production. But I had the same problem when I didn’t have anyone changing data.
[20:52:48] <Odin^^> Shouldn’t matter - I need to trust it will return the right data. It’s a database.
[20:52:53] <skot> which of the fields is an array? images?
[20:53:27] <Odin^^> yes
[20:54:21] <skot> It is hard to tell what is going on without looking at the data, unfortunately.
[20:54:38] <skot> using different indexes should not affect the results
[20:54:57] <skot> (unless you have sparse indexes, but that is another thing which you don't seem to be using)
[20:55:20] <skot> You should be able to run the query without using an index to test if the index is the problem.
[20:55:53] <skot> just add .hint({$natural:1}) before the explain, but that will cause it to look at all the documents and not use an index.
[20:55:54] <Odin^^> https://gist.github.com/spinx/a8ddfacab27a50678337
[20:56:07] <Odin^^> this is the sample document
[20:57:08] <skot> k, I'll try to run your query, with and without the index.
[20:58:13] <Odin^^> how do I disable indexes on .find ?
[20:58:40] <skot> add the hint I provided
[20:59:13] <Odin^^> yep I get all data back
[20:59:24] <skot> $natural is a special "index" which will walk the documents forcing no index to be used.
[21:00:20] <skot> That sample doc doesn't match the query you provided, was it supposed to?
[21:01:08] <Odin^^> oh. just change ‘album’ to : bof_album_53442764d7009
[21:02:52] <Odin^^> random q : are indexes and DB stored in /var/lib/mongodb ? Using Ubuntu.
[21:07:17] <skot> that sounds right, and they are stored in the same files as the data.
[21:08:26] <Odin^^> We moved to EBS optimized for mongodb store. Maybe that’s somehow the problem ?
[21:08:52] <Odin^^> I think devops guy set it to raid.
[21:09:42] <Odin^^> dunno if it could be an aws issue
[21:10:14] <skot> no, I ran it on 2.6 and get an error creating the index.
[21:10:23] <skot> Your index value is too large.
[21:10:44] <skot> It is limited to ~1000 bytes and your index for that doc exceeds that value.
[21:10:58] <skot> this was changed to an error in 2.6, and in 2.4.x it is just a log warning
[21:11:28] <Odin^^> hm
[21:12:08] <Odin^^> Ok so how can I decrease it ?
[21:12:20] <skot> images is not an array.
[21:12:31] <skot> so it is a very large value
[21:13:17] <skot> If you check your logs you will see error about index value too large
[21:13:23] <travisgriggs> Joeskyyy: 785/1235 for used/free
[21:14:24] <skot> Odin^^: http://docs.mongodb.org/manual/reference/limits/#Index-Key
[21:15:00] <skot> It basically causes that index to be sparse, and those docs with large values aren't in the index.
[21:16:06] <Odin^^> Ahh. Got it. I can probably survive w/o images in an index bcz not many of the documents don’t have images
[21:16:41] <Odin^^> But then it probably won’t select the right index.
[21:17:22] <skot> You should remove that index since it is not what you wanted/intended given your docs.
[21:18:17] <skot> Just having an index with the three files should be fine, as you said.
[21:18:24] <skot> s/files/fields
[21:20:02] <Odin^^> ok will do and report
[21:20:37] <Odin^^> Upgrading to 2.6 is trivial or complex ?
[21:23:06] <skot> should be trivial, but could be more complicated if you are using auth or sharding (just requires more steps to upgrade)
[21:23:55] <skot> I'd suggest reading this, http://docs.mongodb.org/manual/release-notes/2.6-upgrade/
[21:24:09] <skot> also, probably best to wait till end of the week or next when 2.6.1 is out.
[21:24:13] <skot> there are a few known issues.
[21:24:34] <skot> https://jira.mongodb.org/browse/SERVER/fixforversion/13794
[21:26:08] <Odin^^> Aaight. Thanks.
[21:30:38] <Odin^^> Brilliant!
[21:30:56] <Odin^^> @skot you may very well saved my launch.
[21:31:21] <skot> good to hear and sorry that it got this far :(