text: const mongoose = require('mongoose');
  const { toJSON, paginate } = require('./plugins');
  
  const commentSchema = mongoose.Schema(
    {
      content: {
        type: String,
        required: true,
      },
      post: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Post',
        required: true,
      },
      user: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'User',
        required: true,
      },
      likes: {
        type: Number,
        default: 0,
      },
    },
    {
      timestamps: true,
    }
  );
  
  // add plugin that converts mongoose to json
  commentSchema.plugin(toJSON);
  commentSchema.plugin(paginate);
  
  /**
   * @typedef Comment
   */
  const Comment = mongoose.model('Comment', commentSchema);
  
  module.exports = Comment;
  