- //模拟数据库数据
{"_id":"1234","name":"name1","weights":[{"detailid":"11111","rWeight":"25","shuzhu":[]},{"detailid":"22222","rWeight":"26","shuzhu":[]}]}- ///下面是云函数
db.collection('collectionName') .where({'weights.detailid':'11111'}).update({data: {'weights.0.shuzhu':_.push({each:[{data1:'3'},{data2:'4'}] }) } })
最近学习做个小的作业,这个'weights.0.shuzhu' 那个0有什么办法可以写成活的
请求个大佬告知!
