om/message.model.js

21 lines
564 B
JavaScript
Raw Normal View History

2019-02-01 14:06:44 +01:00
const mongoose = require('mongoose');
2019-02-08 13:40:21 +01:00
//const Schema = mongoose.Schema,
//ObjectId = Schema.ObjectId;
2019-02-01 14:06:44 +01:00
const MessageSchema = mongoose.Schema({
2019-02-08 13:40:21 +01:00
//_id: ObjectId,
/*id: {
type: String,
getter: function(val) { return this._id.toString(); },
unique: true
},*/
//id: {type: String, required: true},
2019-02-01 14:06:44 +01:00
subject: { type: String, required: true },
message: { type: String, required: true },
user: { type: String, required: true },
tag: {type: [String] },
});
module.exports = mongoose.model('Message', MessageSchema);