Closed PhamelaMhlaba closed 1 month ago
This schema represents user comments on various attractions or locations within the Meeguide travel guide app.It captures essential details about each comment, including the content of the comment, the user who authored it and the specific location or attraction to which the comment is linked.
This schema helps in associating user feedback and insights with particular locations enhancing the app by allowing users to share their experiences and opinions about different attractions.
Description: Create a Mongoose schema for the Comment model. This schema will represent user comments on various attractions or locations. The schema should include fields for the following:
content: A string that holds the text of the comment. It is required. author: A reference to the User model, indicating the user who made the comment. This is a required field. createdAt: A date field to store the timestamp of when the comment was created. It should have a default value set to the current date and time. locationId: A reference to the Location model, representing the specific location or attraction the comment is associated with. This is a required field.