Message.js 382 B

12345678910111213
  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. fileType: {type: String}
  9. })
  10. module.exports = model('Message', Message)