{"size": 467, "ext": "js", "max_stars_repo_path": "server/app/models/comment.js", "max_stars_repo_name": "plutino/myprojecttrack", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/app/models/comment.js", "max_issues_repo_name": "plutino/myprojecttrack", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/app/models/comment.js", "max_forks_repo_name": "plutino/myprojecttrack", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.68, "max_line_length": 57, "alphanum_fraction": 0.6338329764}
const mongoose = require('mongoose');
const Schema = mongoose.Schema

const commentSchema = new Schema({
  createdAt: {
    type: Date,
    default: Date.now
  },
  updatedAt: {
    type: Date,
    default: Date.now
  },
  body: {
    type: String,
    required: 'Comment body cannot be blank'
  },
  author: {
    type : Schema.ObjectId,
    ref : 'User',
    required: 'Comment must have an author'
  }
})

module.exports = mongoose.model('Comment', commentSchema)
