I am currently developing a forum-based application (question / answer).
Using C # ASP.net MVC and MongoDB to store data.
I'm looking at a model now.
I was thinking that I have separate classes: (simplified)
public class Question { public string ID { get; set; } public string Title { get; set; } public string Body { get; set; } public List<string> Tags { get; set; } public DateTime DateCreated { get; set; } public string ForumID { get; set; } }
Answer
public class Answer { public string ID { get; set; } public string QuestionID { get; set; } public string Body { get; set; } public DateTime DateCreated { get; set; } }
My questions:
How to handle "responses"
Itβs best to have (as in the model above) two separate βentitiesβ
Or should I have a list of answers in my question model?
Some requirements are that I will need to display the number of answers, etc.
With this stored in NoSQL db, I know that I have to denormalize things, but how can I insert a response without receiving the whole message? Is such an operation possible using NoRM with MongoDB?
source share