Message.js 399 B

1234567891011
  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. userAvatar: {type: String, required: false} // change to agregation
  8. })
  9. module.exports = model('Message', Message)