PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 30th of June, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:19:21] <halcyon918> when I use a MongoUI and provide a database (mongodb://<user>:<pwd>@<addr>/myDB), how do I get that DB? I tried mongo.getUsedDatabases, but that collection doesn't include my database for some reason. When I do mongo.getDB(myDB), I get the database and have to reauth. So how do I get the DB I authenticated with on connection?
[06:38:08] <DPP> howdy.
[06:38:29] <DPP> I can't recall how to start a replica member whose other members have barfed.
[06:38:48] <DPP> hoping someone can offer enlightment
[09:12:14] <SeanBannister> When querying the DB is it possible to perform a query and if it isn't matched perform a different query. I could perform and $or which will do booth queries but I only need to perform the second query if the first doesn't match.
[09:12:31] <SeanBannister> *an
[13:10:18] <godawful> DPP: this page any help? http://www.mongodb.org/display/DOCS/Reconfiguring+a+replica+set+when+members+are+down
[13:10:32] <godawful> I just went through that too
[13:10:38] <godawful> AWS outage is destroying my weekend
[13:11:04] <godawful> I've got a replica set with two out of three members down
[13:11:36] <godawful> I reconfiged it to make the surviving member the only one, so that it would take over as primary
[13:11:42] <godawful> now I'm adding back recovered members
[16:11:55] <daveluke> hi, i have an attribute called pos which is like {x: 300, y:200}.. it's the coordinates for a player's position in a game… how do i query for other players who are within X distance from that point?
[16:20:07] <jstout> quick, how can i make my slave become a master again
[16:20:30] <jstout> was is failing us
[16:21:20] <skot> Are you using a replica set or master/slave?
[16:22:26] <skot> daveluke: http://www.mongodb.org/display/DOCS/Geospatial+Indexing
[16:22:39] <jstout> skot, yes
[16:22:47] <jstout> our slave auto promoted to master
[16:22:55] <jstout> but our app wasn't configured for this yet so i need to change it back
[16:23:21] <skot> you have to choose one, replica set, or master/slave — they are different configurations.
[16:23:49] <skot> are you starting mongod with the "replSet" option?
[16:24:25] <jstout> hmm
[16:24:32] <jstout> i didn't configure these
[16:24:36] <jstout> and he's not answering his phone
[16:24:51] <jstout> we have 2 secondaries and one primary
[16:24:53] <skot> do you have access to the mongo javascript shell?
[16:24:57] <jstout> yea
[16:25:06] <jstout> i'm in the old master one
[16:25:09] <skot> run rs.status() and post to gist
[16:25:10] <jstout> but now it says SECODNARY>
[16:25:18] <skot> ok, then you have a replica set
[16:25:40] <skot> master/slave replication does not provide automatic failover
[16:25:53] <skot> so you want a specific member to be primary again?
[16:26:16] <skot> http://www.mongodb.org/display/DOCS/Forcing+a+Member+to+be+Primary
[16:26:25] <daveluke> spot, do i need an index on the loc field?
[16:26:31] <daveluke> skot*
[16:26:36] <jstout> https://gist.github.com/e2afd91adee518b2cda1
[16:26:43] <jstout> skot, yeah
[16:26:47] <skot> daveluke, if you want to use a geo query, yes.
[16:26:55] <skot> daveluke, see the docs and examples
[16:28:02] <skot> jstout: looks like you are using 2.0.0+ so you can set the priority in the config as described in the docs.
[16:28:20] <skot> jstout, what language are you using in your client app?
[16:28:42] <skot> you can also fix it there so you use a replica set connection and it automatically figures out who the primary is.
[16:33:06] <jstout> nice
[16:33:12] <jstout> using php
[16:33:28] <jstout> and mongodb odm
[16:33:44] <jstout> we haven't looked into replication yet nor are using it… we just released the app and threw a little traffic to it for testing
[16:33:52] <jstout> being hungover and tired and fixing was problems isn't fun :(
[16:40:03] <jstout> anyway, thanks skots, sites back up
[16:40:20] <jstout> tystr --- thanks for waking up douche!
[17:58:18] <kavelot> can anyone give me suggestions on how to store "history"/versioning information with mongo (something like a wiki, which you may need to know who/when changed what)? considering retrieving the most recent information is the most common operation
[18:17:08] <djbpython1> I'm finding that when i store numbers of type Long they arent being stored as NumberLong, is there any way i can force that?
[18:17:19] <djbpython1> this is using the scala driver, which uses the java driver
[18:18:59] <ron> kavelot: well, there a few ways to do it, but one way is to just store a document per version.
[18:21:08] <kavelot> hm
[18:21:26] <kavelot> using nosql to store a full document per version doesn't seem to give any advantage over using sql, am i wrong?
[18:21:43] <ron> djbpython1: never had that problem.
[18:21:54] <ron> kavelot: yes, you are wrong.
[18:21:57] <ron> :)
[18:22:17] <kavelot> heh, this seems to me the nosql would become a table
[18:22:38] <ron> in a sense, it already is.
[18:22:59] <ron> the basic concepts are the same. no magic involved.
[18:24:05] <kavelot> well, you agree that if I were to save history of only the fields that changed, nosql would have a big advantage in relation to sql? unless you wanted to break your sql in something like a key-value table
[18:24:49] <ron> you could do that, but that would most likely be a poor design.
[18:25:00] <kavelot> yup
[18:25:07] <kavelot> that's why i think nosql would make much more sense for this case
[18:25:31] <ron> I meant the part about the saving only the fields that changed being a poor design, not the breaking the sql tables.
[18:26:00] <kavelot> well, another possibility would be to make a version for each field
[18:26:45] <ron> what would you gain by saving all the changes in one place?
[18:27:33] <kavelot> the question is "what would you gain by not saving the whole document after each change?", which would be disk space
[18:28:04] <ron> one of the main concepts behind nosql is that disk space is cheap and data duplication leads to better performance.
[18:28:23] <ron> once you start toying with that, you'd better go back to sql.
[18:28:54] <ron> it's actually one of the reasons nosql databases failed in the 70's and prior to that. disk space was MIGHTY expensive.
[18:29:47] <kavelot> i'm trying to think on an advantage I'd have to use nosql instead sql in this sceneario... ie, I could create a table with columns "last_updated", "by_whom" and all the field values
[18:30:57] <ron> well, without going into specifics, that would be difficult to say.
[19:14:31] <SkramX> for a super fast mongodb instance
[19:14:35] <SkramX> do i need as much memory as i have data?
[19:23:19] <Derick> yes, that'd be best
[19:23:34] <Derick> but you really only need as much memory as your *working* data set takes
[19:25:01] <ron> otherwise you can just use an in-memory database ;)
[19:25:57] <ron> I should read more about the mechanics of MongoDB some time. I'm pretty familiar with how Cassandra manages its memory and disk access, should be interesting to learn MongoDB's as well.
[19:26:27] <Derick> MongoDB doesn't really... it leaves it to the OS
[19:27:22] <ron> well, I imagine there is some sort of caching mechanism though, no?
[19:28:00] <ron> LRU, LFU?
[19:28:33] <ron> or is that also somehow controlled by the os?
[19:29:23] <Derick> all done by the OS
[19:29:39] <Derick> mongodb operates directly on the memory mapped files on disk
[19:29:52] <ron> Oh, should have realized that. Sorry.
[19:32:18] <SkramX> if i backup often.. im trying to figure out if i should use ephemeral disks on Amazon or EBS
[19:32:40] <SkramX> ephemeral would be faster and better for mongo from what I can rationalize but the quickstart uses EBS
[21:25:01] <jarmstrong> i'm storing user-following-user as an array of ObjectId's, but I really also need to save the date when this occurred - should I just change array to be { date, user_id } which means when I want to do an $in query i'll have to build the array myself. Ideas?
[22:14:42] <massctrl> in pymongo is there a way to query a certain collection of which the depth is unknown in advance? getCollection doesn't seem to exist in pymongo
[22:30:46] <mids> massctrl: depth?
[22:40:37] <massctrl> mids: yes, like for doc in mongo.db['one']['two']['three'].find({}): print doc
[23:01:20] <WillWork4Foo> Hello all. Can anyone tell me - is there some kind of management front-end to Mongodb? perhaps a web BUI?
[23:03:55] <WillWork4Foo> ah - http://localhost:28017
[23:04:08] <WillWork4Foo> bit sparse, but it's there...
[23:04:29] <Guest6151> How's everyone doing?
[23:45:00] <multiHYP> hi
[23:46:02] <multiHYP> in java, I have this document: {"date":"20120630", "things":[]} and when I do a findOne() and cursor.get("things"); I cannot proceed, because the array is empty. so what should I compare it against?
[23:47:09] <multiHYP> cursor.get("date") gives me correct date, but what about cursor.get("things") ???
[23:50:32] <multiHYP> ??? :/