var phone = req.body.phone
var newPeople = new People({
name: name,
friend: [{
friendName: friendName,
phone: phone,
adress: adress,
}]
});
到这里可以取到 phone
的值吗?
newPeople.save(function());
save
方法里
friend: [{
phone: this.phone
}]
这样用 this
赋值可以吗
这种嵌套的数据要怎么赋值