[17:38:07] <SDr> so, I'm doing a thing that is kinda like pinterest: there are boards, boards have posts, posts can be repinned by users to another board. So, I've got a posts table (userId, boardId, content, timestamp) . How would you represent repins on this? Specific operations I need to support are: given a post, who pinned it originally, what other
[17:38:07] <SDr> boards was it pinned to, and selecting original posts _only_ (no repins) . How would you design the schema around this?
[18:51:20] <synthmeat> SDr: dunno exactly how pinterest works, but i'd possibly experiment with shallow (so it's fast to $unwind) and wide (so you have potentially more interesting data in the future) `pins` collection. one that you might later do $graphLookup on to figure out the how pinning flow went, or enable undo over that, etc... something that'd contain information who pinned it, is it an original pin, pinned it from board
[18:51:22] <synthmeat> to board, .. basically all ObjectIds and booleans.
[19:04:39] <SDr> synthmeat, so, like, initial thought: content, timestamp, [ { boardId, timestamp} , {boardId, timestamp},.. ] <- then to generate a feed, I can do filter for $in: [boardId1, boardId2, ..] <- for boards a user follows, then $unwind, select for boardId'd rows, and sort by timestamp
[19:05:23] <SDr> (oh, right, the thing I want to support here is full feed building: given a list of boards a user follows, get a list of latest pins, including repins)
[19:07:01] <SDr> another way might be having a boardpin collection: boardid, pinid, timestamp; in which case, query would be: $in: [boardId1, boardId2, ..] , order: timestamp -1 , then join with pins, which seems really lightweight, as the ID query is indexable, and then the join is ID-based lookup
[19:07:30] <SDr> synthmeat, what do you mean by shallow pins collection?
[19:10:46] <synthmeat> in that it doesn't really contain data beyond objectids and maybe a boolean or two
[22:35:21] <g1eb> hi mongo! im using mongo in a docker container and having trouble connecting to it from a different container
[22:35:37] <g1eb> no matter what uri im setting in my flask container, i get this error: pymongo.errors.ServerSelectionTimeoutError: localhost:27017
[22:36:04] <g1eb> and it's always that localhost + default port, even if I change the env settings manually, anyone seen this before?