[12:06:35] <jammanbo> Are compound mongo indexes like MySQL in that they can be used in queries for any left prefix of the set of indexed fields, or no?
[14:27:53] <macUzer> how can I make mongo treat this { "StartTime" : "/Date(1340380800000-0400)/" } as timestamp?
[14:32:51] <deoxxa> macUzer: by making it into a date
[14:39:09] <macUzer> deoxxa: how? { $type : 17 } shows up as false. Is there a conversion function?
[14:43:56] <deoxxa> macUzer: { StartTime: Date(1340380800000-0400) } would do it
[14:44:12] <deoxxa> (as long as that's actually the date you want...)
[14:44:21] <deoxxa> (it's probably not - 0400 looks like a timezone)
[14:45:05] <deoxxa> depends on how you're inserting it as well. you're probably not just using the mongo shell, so you'd want to consult the manual for whatever driver you're using.
[14:50:10] <macUzer> yes, -400 is timezone. The rest is standard unix epoch time in seconds. I am indeed using the mongo shell, pulling JSON objects from a webservice and inserting directly using mongoimport.
[17:44:12] <Kryten001> Hi, is it possible to automatically remove the value field from a mapreduce output ? and get the data inlined at the root of the object ?
[19:22:14] <dstorrs> hey all. I have a collection of stats related to youtube videos. stats are added once a day, but we do not necessarily get every video every day. I would like to a find() condition that says "give me a cursor to the most recent stat for every video belonging to user X" and I'm having trouble. help?
[19:22:45] <dstorrs> docs look like this => { u : 'user_name', h : $harvested_epoch, .... }
[19:23:43] <dstorrs> it's easy to say "all of BOB's videos from time T". it's the "most recent avalable" part that is getting me.
[19:26:40] <dstorrs> if I do this => find({ u : 'BOB' }).sort({h : -1}) I get almost what I want, except I'll need to do duplicate elimination on client side, and I'll need to know how many videos there are to start with so I know when to stop
[19:32:44] <McNulty_> dstorrs You want .limit() on the end there
[19:34:42] <dstorrs> that would limit the entire thing though, wouldn't it?
[19:39:18] <McNulty_> Well you could do a Map/Reduce but that might not be as performant as you want
[19:39:21] <dstorrs> actually, for this purpose it may not matter. If I only work off the latest harvest, and then I save what I end up with, it would update the ones I find and not the ones I don't
[19:39:40] <McNulty_> Frankly it'd be easier to tag the 'latest' stat each time
[19:40:48] <dstorrs> how would that work? I've got 10M videos overall, spread unevenly across 30k channels. Each channels has 0 - 50,000 videos. We harvest every video every day, and bulk insert their data into the stats collection.