Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+11 votes
asked in CSC490_Spring202021 by (1 point)

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 (1 point)
selected by
...