0
如何将数据插入猫鼬嵌套对象中?我不断收到我的ref集合没有定义的错误!这里是我的代码,我正在尝试将数据插入到address
对象和companyId
将数据插入到Mongoose嵌套对象
var companySchema = new Schema({
company_Id :{
type : Schema.Types.ObjectId,
ref : recruiter,
optional : true
},
address : {
country : {
type : String,
required : true
},
city :{
type : String,
required : true
},
street: {
type : String,
required : true
}
}
你应该阅读文档: http://mongoosejs.com/docs/models.html – Marcs