[08:03:26] <leporello> Hi. I have a couple of documents with field colors which contains array of colors, contained in image. And I have a filter to choose image containing at least one of that colors.
[08:03:49] <leporello> I think i need $in : colors filter for this, but it doesn't work
[08:04:56] <leporello> colors: { $in: ['red'] } gives me all just red images and colors: { $in: ['red', 'yellow'] }} all red and yellow images.
[08:09:36] <leporello> $in and $all give me same result
[12:15:45] <dimon222_> wait you want images with just ['red']?
[12:15:55] <dimon222_> so they shouldn't contain anything else except of red?
[12:16:19] <dimon222_> actually it was 4 hours ago, nvm ;_;
[15:27:49] <sudomarize> Can i get a hand? What's the best way of implementing a category system (that the user inputs themselves)?
[15:29:11] <sudomarize> i.e. i want my users to be able to select from a list of categories (that is variable), e.g. if they select "repair work" as the 1st, then the next select will have "computers, cars, homes, etc" and when they select one of these, the next set of subcategories will be displayed
[15:32:40] <StephenLynx> pre-aggregated sub categories.
[15:32:48] <StephenLynx> I would have a collection of categories
[15:33:21] <StephenLynx> and each category would have both an array of sub categories
[15:57:00] <StephenLynx> but of course, you need a collection for categories and for the items that belong to categories.
[16:13:26] <sudomarize> StephenLynx: schema was probaby the wrong word to use there, perhaps 'model' is more accurate
[16:15:39] <sudomarize> the thing is there are all these different possibilites (models) for setting up such a categorization system, and deciding on one that is relatively flexible (i.e. i can add/remove subcategories easily) and is partial to being searched without too much hassle is proving rather difficult
[16:16:22] <StephenLynx> yeah, because you want subcategories. that is a strongly relational characteristic.
[16:16:32] <StephenLynx> and mongo don't implement relations.
[16:20:37] <sudomarize> right, so the best way of emulating this relational nature is just by giving each category a parent field? what about having an array of parent categories?
[16:31:36] <StephenLynx> when you bend a tool's capabilities, there is no easy answer.
[16:34:47] <sudomarize> StephenLynx: couldnt i just run an update when i need to change fields though? wouldn't this only be a problem if i have a huge number of documents?
[16:35:28] <StephenLynx> but then you need to organize in a way you know the hierarchy of the super categories.
[16:35:49] <StephenLynx> when I always consider large amounts of data.
[16:36:05] <StephenLynx> if you want to make something that will run bad on a big scale, do it.
[16:36:21] <StephenLynx> it might not just work in the future.
[16:38:27] <sudomarize> StephenLynx: ok, how would you personally go about this, assuming you had to use mongodb? maybe implementing a tags field on my documents and then running a fuzzy search on tags + category? you seem like you've got a deep understanding of mongo, would really appreciate your thoughts
[16:46:27] <sudomarize> StephenLynx: alright, i'll implement that. thanks for the advice, appreciate it
[16:46:48] <StephenLynx> btw, it would only hold its immediate super category and it would have just a single super category
[16:49:33] <sudomarize> StephenLynx: oh, as in have a "categories" collection, where the top categories would have {parent: null} and then each subcategory would have {parent:
[16:49:53] <sudomarize> StephenLynx: oh, as in have a "categories" collection, where the top categories would have {parent: null} and then each subcategory would have {parent: "somecategory", ancestors: ["topcategory", "somecategory"]}?
[18:15:24] <fxmulder> so I am cloning one replica to another and after a while the primary machine I am cloning died from lack of memory. Is there a memory leak in 2.4?
[23:47:59] <parallel21> Trying to add a new field to all documents in this db