如果我想在下面的架构中添加一些数据:
'use strict';
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var notificationsSchema = new mongoose.Schema({
notifyMessage : {
title : { type: String },
des : { type: String }
},
notifier : { type: String },
recipient : [{
id : { type: String },
status : {type:String,trim:true,enum:['read','unread']}
}]
});
module.exports = mongoose.model('notification_tracker', notificationsSchema);
我试过这种方式:
但它以这种方式结束了..