From 2f90b146259a6b18360c5b47ed608ca5860b6b01 Mon Sep 17 00:00:00 2001 From: senta_mandutz Date: Tue, 16 Apr 2019 21:23:50 +0200 Subject: [PATCH] added array to tag type --- message.model.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/message.model.js b/message.model.js index de06898..1ad6a52 100644 --- a/message.model.js +++ b/message.model.js @@ -4,17 +4,11 @@ const mongoose = require('mongoose'); //ObjectId = Schema.ObjectId; const MessageSchema = mongoose.Schema({ - //_id: ObjectId, - /*id: { - type: String, - getter: function(val) { return this._id.toString(); }, - unique: true - },*/ - //id: {type: String, required: true}, subject: { type: String, required: true }, message: { type: String, required: true }, user: { type: String, required: true }, - tag: {type: String }, + tag: [{type: String, index: true }], + //createtime: { type: Date, default: Date.now }, }); module.exports = mongoose.model('Message', MessageSchema);