Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

message.model.js 462B

123456789101112131415
  1. const mongoose = require('mongoose');
  2. //const Schema = mongoose.Schema,
  3. //ObjectId = Schema.ObjectId;
  4. const MessageSchema = mongoose.Schema({
  5. subject: { type: String, required: true },
  6. message: { type: String, required: true },
  7. user: { type: String, required: true },
  8. tag: [{type: String }],
  9. //createtime: { type: Date, default: Date.now },
  10. });
  11. MessageSchema.index({tag:'text'});
  12. module.exports = mongoose.model('Message', MessageSchema);