[00:16:18] <crudson1> bobinator60: use $group to put them back together
[00:28:05] <dougb> I'm trying to write an aggregation where match is comparing a field to a value, but when I try to run it I get: invalid operator: $eq. Is there another way I can compare two values?
[00:35:15] <crudson1> dougb: create a paste of your command
[00:36:58] <dougb> crudson1: it's in Go, this is what was throwing me an error: http://pastie.org/private/i5x8nyw9yn3phpcfxo395w and I changed it to this: http://pastie.org/private/tqaww0fb9qqgpcf2kbujw. It's not throwing an error, but now it's not displaying any results
[00:38:40] <crudson1> dougb: ok you fixed the match syntax, but it should be before the group in the pipeline, your group isn't outputting a 'PlacementID' attribute
[00:39:36] <dougb> ah, so simple :) Thank you very much, that worked perfectly
[06:43:14] <E2ven> Is there an easy way to say "Give me all documents, with the following criteria, that have matching values for field foo?
[06:43:48] <E2ven> It looks like perhaps the agg. framework's $match might work?
[07:03:28] <crudson1> E2ven: normal .find() will match documents for a given criteria. do you have an example if you think it's more complex than thsat?
[07:04:11] <E2ven> Having thought about it, I think I'd have to do it with $group, and it'd not be nice to the CPU.
[07:04:33] <E2ven> For example, let's say I wanted to find all the people with matching birthdays.
[07:05:07] <E2ven> The agg. framework $group by birthday would work. But it'd pull them all into memory.
[07:05:52] <E2ven> I'll just loop manually for each value.
[19:13:40] <mastergberry> Hi. I seem to be having some issues querying for basic data in my mongodb collection. I have a feeling its some formatting issue due to python/parsing/mongodb. Hoping someone can help me here: http://pastebin.com/nL4tYB1J
[19:13:51] <mastergberry> The first paste is the raw data I am parsing from the file. The second is the "nice format" of it
[19:14:04] <mastergberry> Errr, my mistake. The first is what is actually stored in the database
[19:15:33] <mastergberry> And this is what it looks like when printed from the python console using the json module: http://pastebin.com/Rkb7uF7a
[19:16:02] <mastergberry> I think one of the main issues is the statsJSON has an extra quotation set around it (which it shouldn't)
[19:16:29] <mastergberry> but the other thing is I can't seem to query by some of the fields. For instance gameId works but mapId doesn't
[19:18:00] <heewa> mastergberry: Well, it looks like you stored statsJSON in the db as a string value. If that's what you meant to do, you can do another json.loads() of that field.
[19:18:40] <mastergberry> heewa yeah, sounds about right. I just realize it was a string. But that doesn't really explain why the other fields (not in the statsJSON) aren't working properly
[19:18:47] <mastergberry> maybe it does :/ let me try to clean that up
[19:24:47] <mastergberry> heewa, ok that seemed to have fixed the statsJSON issue I was experiencing. but I seem to still be having problems
[19:32:11] <heewa> haha, sometimes takes a fresh eye
[19:34:09] <mastergberry> heewa, Looking at this: http://pastebin.com/YDWm8eT5 Maybe you could help me understand a bit more about querying with mongodb
[19:34:33] <mastergberry> In statsJSON there are 6 dicts in this case
[19:34:54] <mastergberry> How would i put together a query looking for ITEM0 being 1053 OR 1036 for instance
[19:40:04] <mastergberry> Hmmm, well for instance, in this case there are 6 players
[19:40:08] <mastergberry> each of the 6 players has 6 items
[19:40:22] <mastergberry> recorded currently in ITEM0-ITEM5 for each player
[19:40:49] <mastergberry> I probably should rearrange the data a bit to make it easier to query
[19:41:14] <mastergberry> which would be easier to query right?
[19:43:58] <heewa> I don't get what you're saying. You can query the DB to return a record, but if you care about a sub-part of that record, you can filter that out yourself once you have it, or you can subselect some fields, but I don't think you can query within a list inside one record as if it was a collection.
[19:46:21] <heewa> That query I showed up just now will find a record in the replay collection that has an item in the statsJSON list with ITEM0 == 1053. If you only want that item itself, you can then take the record the query returned and grab that item from the list. Does that make sense?
[19:47:40] <heewa> In python, it'd be something like: thing = [x for x in record["gameData"]["statsJSON"] if x["ITEM0"] == "1053"][0]
[21:11:48] <gaf> hi, I would like your opinion about using mongo for a certain web app. would be something like http://www.kitchenpc.com/ , where the "recipies" would be stored in mongo, than after searched on the client side. i will be using node for the http api. so, is a good fit?
[22:05:55] <Link-> assuming i have 100 users, does creating a collection for every user that contains all its data a good design or an extremely bad one?
[22:45:59] <aandy> Link-: what's your reasoning for not using one collection (just curious)?
[23:59:31] <MasterGberry> Hey, does anyone have a s econd to take a quick look @ my SOF question and tell me if it is possible or if I should re-organize the data: http://stackoverflow.com/questions/17003386/mongodb-create-query-with-not-equal-teams-and-championid-in-group