import mongoose, { Schema } from "mongoose"

const comment = new Schema({
  timestamp: {
    type: Number,
    required: true
  },
  author: {
    type: String,
    required: true
  },
  content: {
    type: String,
    required: true
  }
})

comment.virtual("id").get(function() {
  return this._id
})

const Comments = mongoose.model("Comment", comment)

export { comment }
export default Comments

@@ -209,38 +209,259 @@
 String,%0A    
-required: true
+validate: %7B%0A      validator: function(v) %7B%0A        return typeof v === %22string%22%0A      %7D,%0A      message:%0A        %22The comment does not seem to be a type of string. I got the value %7BVALUE%7D when I at least expected an empty string.%22%0A    %7D
 %0A  %7D%0A%7D)%0A%0Acom

Fix validation of content field of comment model