我想知道如何在moongoose纲要中添加一个字符串数组。猫鼬纲要如何添加数组
我有以下的代码,但它不工作:
var message = new Schema({
topic: String,
content: String,
restriction:String,
sender:String,
reciever:String,
users:[String],
read:{type: String, default: 'no'},
like:{ type: Number, default: 0 },
created_at: {type: Date, default: Date.now}
});
我谈论users
。你能帮我吗?
每个文档:http://mongoosejs.com/docs/schematypes.html'用户:[字符串]'工作正常,因为你写了它。你可以详细解释一下哪些代码不适用? – Paul