PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 3rd of February, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:24:04] <leitz> can you use find and sort on two different keys?
[00:30:43] <Bilge> Oh great my Mongo just got upgraded to 2.2.3 and now it doesn't work
[00:30:49] <Bilge> send_package: error reading from socket: The socket is closed
[00:30:52] <Bilge> Really? What the fuck
[00:34:04] <Bilge> Nothing a reboot can't fix
[00:56:16] <pquery> anyone know why shard chunks wouldn't show up in a new shard after 12 hours?
[03:45:37] <advorak> This is probably a simple problem, but I'm not sure where to start looking in the documentation (I've just started using mongodb again recently) --- I have the following document format: {eligibles: {mobile: false, home: false, randomfieldname: true} }
[03:45:58] <advorak> I want to match all documents where a value in eligibles.* matches true ..
[03:50:41] <bean__> Probably need a mapreduce job for that
[03:52:37] <advorak> is there a better way that I should be organizing my data the would be better for searching in mongodb?
[03:53:25] <bean__> tbh I'm a sysadmin so I'm not really qualified to answer.
[03:54:49] <advorak> bean__, thanks for the idea, then :-)
[04:18:36] <advorak> how do I use "dot notation" when a key name has a space in it? http://docs.mongodb.org/manual/reference/glossary/#term-dot-notation
[04:28:34] <joshua> advorak: how did you end up with spaces? yikes
[05:26:36] <advorak> joshua: I figured it out.. though the reason for the spaces is that I'm scraping a website ..
[10:11:14] <jd823592> Hello, anyone who could advise me with mongodb for node.js? (mongoose)
[13:25:44] <leitz> How do you find a doc based on _id? This doesn't seem to work: db.grades.find({_id: '50906d7fa3c412bb040eb895' })
[13:26:37] <algernon> leitz: wrap it in an ObjectId()
[13:27:08] <algernon> leitz: _id: '...' searches for a string id, while most likely, it is an ObjectId
[13:28:07] <leitz> algernon, thanks. Still trying to find what quotes, if any to use. I had tried ObjectId("...") and am now trying others.
[13:29:10] <leitz> A-HA! ObjectId('...')
[14:13:55] <pquery> If I get a data transfer error when moving a chunk in a sharded collection is that a connectivity issue or config server issue or what? http://pastie.org/private/p0qa5mhz69xuqqws7plaog
[14:54:29] <devnill> I'm using mongoose.js in node and I'm having trouble figuring out exactly how to limit Model.update(). Is this possible?
[15:35:31] <pquery> is there a way in the config file to have the logs rotate automatically?
[15:42:47] <devnill> pquery: I'm not sure if mongo has a method to do it, but I use rsyslog
[16:26:28] <bean__> pquery: I'd use logrotate on your system
[18:09:05] <daslicht> http://play.wakanda.org/?utm_source=forum&utm_medium=playwakanda
[19:38:07] <nachoelg> hello guys
[19:38:44] <nachoelg> can i ask you a question i am working on ..
[19:38:54] <nachoelg> it´s been very painful so far
[19:39:53] <nachoelg> I have a collection to simply with two filelds date, money
[19:41:06] <nachoelg> and I need a query to get the information for this month to the result would be: date(this month), money(sum of this month's money), moneyLastMonth(sum of last month's money)
[19:41:30] <nachoelg> I could get this with two queries but i can´t join the two fields
[19:41:47] <nachoelg> I come from SQL so maybe that why i am confused
[19:50:02] <kali> nachoelg: the easiest way is to perform two queries and join them yourself after that
[19:51:49] <kali> as a matter of fact, on single request seems enough
[20:05:39] <nachoelg> hi kali
[20:05:49] <nachoelg> yes thats what i thought
[20:06:04] <nachoelg> the problem is merging filelds after
[20:06:44] <nachoelg> one query is date,money1 and the other date,money2 how do i merge this into one with a share field(date)
[20:07:12] <kali> nachoelg: you do that in whatever language you're conmfortable with
[20:07:25] <kali> nachoelg: mongodb goes less far than SQL as far as reporting is concerned
[20:07:56] <kali> nachoelg: the philosophy is also not to distract your database with mundane task like offseting and merging two lists :)
[20:08:17] <nachoelg> ok. I am confortable more or less with javascript but it seems it is not an easy task to do it
[20:09:17] <kali> how far have you gone ?
[20:09:29] <kali> paste where you are somewhere
[20:09:31] <kali> not her.
[20:09:35] <kali> +e
[20:09:40] <nachoelg> imagine i got this var data1=[{date:1,money:7},{date:2,money:6},{date:3,money:100}] and data2=[{date:1,money2:19},{date:2,money2:7},{date:3,money2:37}]
[20:10:27] <kali> i thought you add aggregated data per month ?
[20:10:53] <nachoelg> and i want date3=[{date:1,money:7,money2:19},{date:2,money:6,money2:7},{date:3,money:100,money2:37}]
[20:11:06] <nachoelg> this is to simplify
[20:11:49] <nachoelg> i gotta do it in a good performing manner because there are many rows and it is a real-time query report
[20:12:40] <kali> well.. anyway ... var data3 = [] ; for(i = 1 ; i < data1.size) { data += [{ date:data1[i].date, money1:data1[i].money, money2:data2[i].money2 } ] }
[20:12:47] <kali> ha !
[20:12:48] <kali> real time
[20:13:13] <kali> well, on month, you'll never get a huge number of rows
[20:13:25] <kali> so anything faster than shell will get you a long way
[20:14:16] <nachoelg> I am getting good performance in SQL but i was planning to go for mongodb
[20:14:40] <nachoelg> in SQL is just two queries and a join for the field date
[20:14:53] <nachoelg> so i think it could be faster
[20:15:03] <kali> the expensive part is aggergating the data per month
[20:15:18] <kali> the rest is a formatting joke. anything will work.
[20:17:40] <nachoelg> I can get the aggregating part to work fast in mongo, i have it already. But I am having troubles merging, and it couldbe more that 2 data. For example date1 is list of moths in 2012, date2 the same for 2011 and date3 the same for 2010
[20:18:01] <nachoelg> I think i am not explaining very well sorry
[20:18:44] <nachoelg> i cant understand the function you just wrote
[20:19:04] <nachoelg> I think it will need 3 nested loops, one per data array
[20:19:44] <kali> sorry, i think i need a real example :)
[20:20:00] <nachoelg> for example for date=1, you need to grab money1 from data1 and money2 from data2 (where date=1) ..
[20:20:55] <kali> ha yeah, my function should read data2[i-1] at the end, to get the offset
[20:21:04] <kali> or +1 i'm not sure :)
[20:22:03] <nachoelg> hehe
[20:22:42] <nachoelg> its confusing
[20:22:54] <leitz> Any pymongo help? I'm still trying to figure out lines 39 and 44; how to structure a remove query. http://pastie.org/6034793
[20:22:58] <nachoelg> i get this date1=[ {month:1,money:12}, {month:2,money:13}, {month:3,money:13}, {month:4,money:20}, {month:5,money:30}, {month:6,money:30}, {month:7,money:30}, {month:8,money:20}, {month:9,money:20}, {month:10,money:20}, {month:11,money:21}, {month:12,money:21}, ];
[20:23:09] <nachoelg> and that date2=[ {month:1,money:42}, {month:2,money:43}, {month:3,money:13}, {month:4,money:20}, {month:5,money:40}, {month:6,money:40}, {month:7,money:40}, {month:8,money:40}, {month:9,money:40}, {month:10,money:40}, {month:11,money:41}, {month:12,money:41}, ];
[20:24:53] <nachoelg> and i want this date3=[ {month:1,money:42,money2:12}, {month:2,money:43,money2:13}, {month:3,money:13,money2:13}, {month:4,money:20,money2:20}, {month:5,money:40,money2:30}, {month:6,money:40,money2:30}, {month:7,money:40,money2:30}, {month:8,money:40,money2:20}, {month:9,money:40,money2:20}, {month:10,money:40,money2:20}}, {month:11,money:41,money2:21}}, {month:12,money:41,money2:21}}, ];
[20:26:14] <kali> nachoelg: don't paste stuff here. pastie.org is here for that
[20:28:40] <nachoelg> ok sorry
[20:30:40] <kali> nachoelg: http://pastie.org/6034831
[20:30:47] <nachoelg> http://pastie.org/6034832
[20:33:46] <nachoelg> I guess if I sorted by month just one loop would do it
[20:34:07] <nachoelg> but no that not correct because one year could lack one month
[20:34:23] <nachoelg> for example 2010 does not have data in july ..
[20:35:04] <nachoelg> thats the problem
[20:35:30] <kali> that's quite easy to fix, just add the missing values before joining...
[20:36:12] <kali> or tranform the data in dictionary with month being the key
[20:37:22] <nachoelg> what do you mean by dictionary?
[20:37:41] <kali> hash table
[20:38:30] <nachoelg> ok
[20:38:34] <nachoelg> thank you for your help
[22:05:25] <JEisen83> Hey... I'm trying to diagnose a strange RS DNS issue. I have a few identical instances I'm adding to an existing replica set called mongo-new-01, mongo-new-02 and mongo-new-03. (All full DNS-resolvable names.) I'm able to rs.add mongo-new-01 and mongo-new-03 by name with no problem, but mongo-new-02 fails with the error about not finding self in new config. If I add it via IP, it works fine, but that makes it much more diffic
[22:05:25] <JEisen83> to track. Any ideas of where I can look?
[23:10:06] <ronson> Hi, if I have a collection that looks like this http://pastie.org/pastes/6035344/text?key=sedvugtexfrkzut6kcrgq, how do I find season 1 episode 2 of show Cool?
[23:10:18] <ronson> db.shows.find( ? )
[23:11:42] <Zelest> db.shows.find({name: "Cool", "episodes.season" : 1, "episodes.episode": 2})
[23:11:44] <Zelest> i think
[23:15:11] <ronson> Zelest thanks i think it works
[23:16:07] <maplebed> Hi, reading http://docs.mongodb.org/manual/reference/current-op/#currentOp.locks it says that locks replaced the lockType. I used to be able to find reads by saying 'lockType == read' or writes by 'waitingForLck && lockType != "read"'. How do I search for only reads with this new format? it doesn't have read/write. Anybody have an example I can follow?
[23:45:30] <ronson> Zelest: actually that doesnt work
[23:45:39] <ronson> episodes is an array so dot notation doesnt work
[23:46:01] <_sri> what's the difference between $err, err and errmsg?
[23:46:44] <_sri> (quite hard to google for those terms... maybe someone has a link?)