猫鼬模式无法在数组中创建数组,我该怎么做?
plantationLocation和productExpense字段如何添加?
seasonIdentification: [{
....
plantation: [{
.....
plantationLocation: [{
....
}],
productSheama: [{
.....
productExpense: [{
....
}],
}]
}]
exports.plantationLocation= function (req, res) {
agriculture_User.update({_id:req.params.id,'season._id':req.params.seasonId,'plantation._id':req.params.plantationId}, {
'$push':{
'seasonIdentification.$.plantation.$.plantationLocation':[{
'lat': 1231,
'long': 12345,
'Accuracy': 123456,
}]
}
}, function (err, product) {
if (err) res.send(err);
res.send('Plantation Location true.');
});
};