Message.js 351 B

123456789101112
  1. const {model, Schema} = require('mongoose');
  2. const Message = new Schema({
  3. text: {type: String, required: true},
  4. userName : {type: String, required: true},
  5. createDate: {type: Date, required: true},
  6. user: { type: Schema.Types.ObjectId, ref: 'User' },//not using
  7. file: {type: String}
  8. })
  9. module.exports = model('Message', Message)