chingu-voyage7 / Bears-Team-17

CarTalk - A community designed for car enthusiasts | Voyage-7 | https://chingu.io/
5 stars 0 forks source link

Differentiate between replies and comments #8

Open Francis-Njoku opened 5 years ago

Francis-Njoku commented 5 years ago

@psitronic do we currently have this on the model design, I looked at the model for answers and questions, perhaps a foreign key

nikrb commented 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?

psitronic commented 5 years ago

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.

nikrb commented 5 years ago

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 😕

psitronic commented 5 years ago

Oh, yes, it is a copy-paste bug.

Francis-Njoku commented 5 years ago

I'm thinking we could have an extra field on answer table that could serve as foreign key for replying answers

nikrb commented 5 years ago

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.

psitronic commented 5 years ago

Guys, everything is in ERD discussed here

nikrb commented 5 years ago

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.

psitronic commented 5 years ago

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.