Open Francis-Njoku opened 5 years ago
@psitronic only just noticed ... answers field in the question table, shouldn't that have a reference to answer table, not user? Similarly with answer table and comments field. Do we gain anything having a separate anwers table? We could just store the answers as sub-doc's in the question table?
Yes, we could do so, but if we have answers as sub-docs in the question collection and comments as sub-docs in the answers collection it can be too complicated for full-text search later on.
Actually, there is no real reference for nosql DBs (ERD is also very abstract, but anyways you can see links between collections). In models ref is used in order to convert _id to the real name.
re: search, ok fair enough. re: db refs. Not sure what you are getting at, my point was that the ref for answers points to users 😕
Oh, yes, it is a copy-paste bug.
I'm thinking we could have an extra field on answer table that could serve as foreign key for replying answers
replying answers, are we talking about comments? I don't think we've got that far yet, but yes I think so at some point.
yes it's all in the ERD, but not in the models which I think is what Francis is referring to. I suppose the comments field in the answers table could be a ref or sub-doc.
Sure, it's just an MVP. I thought to embed comments as an array of objects to the answers field of the answers table but not now.
@psitronic do we currently have this on the model design, I looked at the model for answers and questions, perhaps a foreign key