Question: Design a database using MongoDB to support the content management system of a blog. The database must store the following information: Articles: Page URL

Design a database using MongoDB to support the content management system of a blog. The database must store the following information:

 

  • Articles:
    • Page URL
    • Article title
    • Article ID
    • Page Content
    • Author name
    • Author email
    • Author picture URL
    • Author short bio
  • Comments
    • Each article can have 0 or unlimited number of comments
    • Content of comment
    • Date and time posted
    • Handle of comment poster
    • ID
  • Views and activity
    • User agent
    • Date and time
    • Description of event (view, like, share)
    • Type (comment, article)
    • Content ID

Deliverable:

 

  • Code to create the data to be inserted to the database
    • Insert at least 12 articles
    • Each article must have a random number of likes
    • Each article must have at least one comment
    • At least one comment must be liked
  • Query to aggregate and calculate:
    • Number of views per article
    • Average number of comments per article
    • Article ID of the most liked article

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!