text: const mongoose = require('mongoose');
  
  const Schema = mongoose.Schema;
  
  const mySchema = new Schema({
    chat: {
      type: Schema.ObjectId,
      ref: 'Chat',
    },
    user: {
      type: Schema.ObjectId,
      ref: 'User',
    },
    message: {
      type: String,
      trim: true,
      required: true,
    },
    file: {
      type: String,
    },
    date: {
      type: Date,
      default: Date.now,
    }
  });
  
  module.exports = Model = mongoose.model('Message', mySchema);