[12:02:48] <Const> I need some help with an aggregate... I have a document like http://pastebin.com/8JNwg1RF and I'd like to get the (up-to 3) most used tags on the last 3 weeks. Any idea how to do that?
[12:06:19] <Const> it should return something like { { "test2": 9 }, { "test": 8 } }
[13:41:40] <ome> Mongos ID's leak too much information. Machine, Time, Counter. What is the best way to create UUID for users?
[13:42:17] <ome> And by that, I mean, UUIDs that I can publicly share without leaking mentioned information.
[18:37:20] <azeirah> I'm trying to model the relation between two users (I'm building a friends system), but I'm having trouble. My original approach was to create a reference in both users to each other, but that quickly creates some complications.
[18:38:18] <azeirah> So I was thinking about creating a separate collection, "friends", but I can't think of a decent way to model that either
[18:47:12] <faeronsayn_> @azeirah? Can't you have something like friends: [ array ] ?
[18:48:44] <azeirah> The queries get unnecessarily very complex very quickly and I have duplicate data
[18:51:30] <azeirah> Well, to be fair, the main problem with it is that I can't accurately describe the relationship between the two users. I have to update a relation in two places instead of one which doesn't make much sense, especially since I shouldn't be able to change another user's data (I'm currently storing the relation under user.profile.friends)
[18:55:41] <faeronsayn_> @azeirah take a look at this http://stackoverflow.com/questions/25344444/best-model-for-representing-many-to-many-relationships-with-attributes-in-mongod
[18:59:40] <faeronsayn_> @azeirah if you have attributes in your relationship, then it gets difficult. If you just have an array of ids I don't think it's that bad, if you need to update both users (it's still one collection).
[19:00:42] <azeirah> @faeronsayn_ I only need one attribute, the relation status, either "friends" or "request". No relation simply means they aren't friends
[19:02:05] <faeronsayn_> @azeirah why not use followers and followees instead?
[19:02:49] <faeronsayn_> You can always split friends and friendRequests into two different fields. on the users collection
[19:03:57] <azeirah> It'll reduce the complexity a little, true, but I would still have the problem of having to update the relation in two different places. Both users need to know that they're friends with each other, it's not like twitter where you can follow someone without the other following you back
[19:29:30] <mango_> Has anyone gone through M102: Homework - 6.2