123456789101112131415 |
- const mongoose = require('mongoose');
-
- //const Schema = mongoose.Schema,
- //ObjectId = Schema.ObjectId;
-
- const MessageSchema = mongoose.Schema({
- subject: { type: String, required: true },
- message: { type: String, required: true },
- user: { type: String, required: true },
- tag: [{type: String }],
- //createtime: { type: Date, default: Date.now },
- });
- MessageSchema.index({tag:'text'});
-
- module.exports = mongoose.model('Message', MessageSchema);
|