models/Post

Post model module.
Source:

Requires

  • module:mongoose

Type Definitions

Comment

Properties:
Name Type Description
user Schema.Types.ObjectId Reference to the user who commented.
text string The text content of the comment.
name string The name of the user who commented.
avatar string The avatar URL of the user who commented.
date Date The date when the comment was posted (default: Date.now).
Source:
Type:
  • Object

Like

Properties:
Name Type Description
user Schema.Types.ObjectId Reference to the user who liked the post.
Source:
Type:
  • Object

PostSchema

Post Schema for MongoDB.
Properties:
Name Type Description
user Schema.Types.ObjectId Reference to the user who created the post.
text string The text content of the post.
name string The name of the user who created the post.
avatar string The avatar URL of the user who created the post.
likes Array.<Like> An array of likes for the post.
comments Array.<Comment> An array of comments for the post.
date Date The date when the post was created (default: Date.now).
Source:
Type:
  • Object