Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes
asked in CSC490_Spring202021 by (8 points)

1 Answer

+2 votes
 
Best answer

You could create a branch under whatever you need comments for, whether its posts, people, etc., and then list the comments under there with either keys for however you want to order them, or unique keys and when you get the information from the database you can tell it to order by a certain field. For example, if each comment has a user, text, and date field, you can have the comments be ordered by date when you pull them.

-POST

 -Information
 -Information
 -Comments
         -Comment 1
               -User:
               -Text:
               -Date
         -Comment 2
               -User:
               -Text:
               -Date
answered by (8 points)
selected by
...