[02:17:32] <mastyd> Can someone help me with aggregation: https://gist.github.com/dmastylo/f8da4a3dead2323d5ed1. The firstPlace attribute isn't working, I want to count the number of "0" ranks a player has all together
[02:18:22] <mastyd> but I don't want only players who have gotten first place to be in the results, which is why the $match is not outside, but obviously $match doesn't work when inside of $group
[02:19:51] <joannac> mastyd: um, I don't actually understand what you're trying to do
[02:21:10] <mastyd> @joannac, I'm grouping players by their playerId (external reference to another DB), and I want the specific fields distance, prizeCents, gamesPlayed, coins, and firstPlace to be available in the result. firstPlace should be the number of times that group has a rank = 0
[02:21:32] <mastyd> So imagine you have 10 users with userId 1
[02:22:07] <mastyd> 5 of those have a rank 0, and the other 5 are 2, 3, 10, 5, 8, etc. doesn't really matter. But I want to display that firstPlace = 5 because 5 of those in that group have a rank 0
[02:22:14] <mastyd> Does that make more sense? Hopefully
[02:24:52] <joannac> have a project stage where you turn every document with rank=0 to isFirst=1
[02:25:03] <joannac> and every document with rank != 0 to isFirst = 0
[02:25:10] <joannac> and then sum up the isFirst values
[02:25:41] <mastyd> project stage before the group stage, okay let me try that and let you know if I run into issues. Thanks a ton!
[02:31:27] <mastyd> @joannac: having a hard time putting this together, this is honestly my first time doing an aggregation query in mongo
[02:33:15] <mastyd> @joannac: I have this: https://gist.github.com/dmastylo/f8da4a3dead2323d5ed1 but I'm not getting the expected results. I'm getting a null '_id' result and just one row
[02:36:13] <mastyd> @joannac: Nevermind I got it! Thanks a ton for the projection advice. So basically that lets you select which fields to return and manipulate them before the group, and the group lets you sum or avg or whatever on those fields
[02:36:17] <mastyd> I think I'm starting to get aggregation
[02:38:11] <joannac> mastyd: I find it helpful when writing an aggregation pipeline to do it one bit at a time, and check the documents look how I want
[02:39:07] <mastyd> @joannac: yeah that's what I was doing. Are aggregation queries fast or no? I mean I guess it depends what you're doing and if you have proper indexing and whatnot
[02:40:05] <joannac> exactly. depends what you're doing, how much data you're precessing, what else is running at the same time, etc
[02:41:09] <mastyd> how would you recommend to index fields in a query like i'm doing?
[02:41:24] <mastyd> I just updated it to my final version
[02:42:19] <stuntmachine> any good guides for fixing this on centos 6? http://pastebin.com/raw.php?i=bGZdsqaz
[02:42:42] <stuntmachine> this shows up as soon as I run mongo on a default install of mongo 3.0.5
[02:44:16] <stuntmachine> The second warning message (re: defrag) remains. I already tested on another box.
[02:45:51] <joannac> stuntmachine: there's no message around "defrag" in that pastebin
[02:45:57] <stuntmachine> i just thought maybe there were better details out there than the official ones around this particular issue on centos 6.x. i spent a few hours on this the other night and saw a few stackoverflow pages, etc, but none helped me get rid of that defrag warning. i'm trying to set things up as perfectly as i can from the getgo
[05:48:09] <sabrehagen> is there a way to query against a field name/document key where the match is a regex. e.g. my documents have keys 'event', 'event2', 'event3'. i want to query all possible eventX keys in the document for a certain value.
[06:29:21] <Boomtime> sabrehagen: you can't - in order to construct a query you need to be able to specify the field on which you are querying - dynamic field names is poor schema design, usually you should be using an array or sub-document instead
[06:30:02] <Boomtime> in your case, it sounds like you should have a single 'event' field which is an array of subdocuments, or similar
[06:32:38] <sabrehagen> Boomtime: thanks for the advice
[08:50:28] <Derick> gemtastic: better to just ask your question!
[08:50:58] <gemtastic> Derick: Well, that WAS my question.
[08:51:50] <gemtastic> Most people in here is logically assumed to work with MongoDB in one way or another, but that's no guarantee that any one working with MongoDB through Node is here :P
[08:52:10] <gemtastic> I was just curious if they hang here
[09:10:26] <gemtastic> It's ok, noone has to out themselves with working with Node if they don't want to ;P
[09:43:21] <morenoh149> I work with node and mongodb