Closed tracybrtn closed 2 years ago
User
[x] username
[x] email
[x] thoughts
Array of _id values referencing the Thought model
[x] friends
Array of _id values referencing the User model (self-reference)
[x] Schema Settings
Create a virtual called friendCount that retrieves the length of the user's friends array field on query.
Thought
[x] thoughtText
[x] createdAt
[x] username (The user that created this thought)
String
Required
[x] reactions (These are like replies)
Array of nested documents created with the reactionSchema
Create a virtual called reactionCount that retrieves the length of the thought's reactions array field on query.
Reaction (SCHEMA ONLY)
[x] reactionId
Use Mongoose's ObjectId data type
Default value is set to a new ObjectId
[x] reactionBody
280 character maximum
Date
Set default value to the current timestamp
Use a getter method to format the timestamp on query
This will not be a model, but rather will be used as the reaction field's subdocument schema in the Thought model.
Models
User
[x] username
[x] email
[x] thoughts
Array of _id values referencing the Thought model
[x] friends
Array of _id values referencing the User model (self-reference)
[x] Schema Settings
Create a virtual called friendCount that retrieves the length of the user's friends array field on query.
Thought
[x] thoughtText
[x] createdAt
[x] username (The user that created this thought)
String
Required
[x] reactions (These are like replies)
Array of nested documents created with the reactionSchema
[x] Schema Settings
Create a virtual called reactionCount that retrieves the length of the thought's reactions array field on query.
Reaction (SCHEMA ONLY)
[x] reactionId
Use Mongoose's ObjectId data type
Default value is set to a new ObjectId
[x] reactionBody
String
Required
280 character maximum
[x] username
String
Required
[x] createdAt
Date
Set default value to the current timestamp
Use a getter method to format the timestamp on query
[x] Schema Settings
This will not be a model, but rather will be used as the reaction field's subdocument schema in the Thought model.