Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate between replies and comments #8

Open
Francis-Njoku opened this issue Dec 2, 2018 · 9 comments
Open

Differentiate between replies and comments #8

Francis-Njoku opened this issue Dec 2, 2018 · 9 comments

Comments

@Francis-Njoku
Copy link
Contributor

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

@nikrb
Copy link
Contributor

nikrb commented Dec 2, 2018

@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
Copy link
Contributor

psitronic commented Dec 2, 2018

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
Copy link
Contributor

nikrb commented Dec 3, 2018

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
Copy link
Contributor

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

@Francis-Njoku
Copy link
Contributor Author

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

@nikrb
Copy link
Contributor

nikrb commented Dec 3, 2018

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
Copy link
Contributor

psitronic commented Dec 3, 2018

Guys, everything is in ERD discussed here

@nikrb
Copy link
Contributor

nikrb commented Dec 3, 2018

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants