PrivateMessage.js 430 B

12345678910111213
  1. const {model, Schema} = require('mongoose');
  2. const PrivateMessage = new Schema({
  3. text: {type: String, required: true},
  4. createDate: {type: Date, required: true},
  5. fromUser:{ type: Schema.Types.ObjectId, ref: 'User' },
  6. toUser:{ type: Schema.Types.ObjectId, ref: 'User' },
  7. file: {type: String} , // not in use
  8. fileType: {type: String} //not in use
  9. })
  10. module.exports = model('PrivateMessage', PrivateMessage)