mongodb中存储着类似结构的数据:
{
_id:"10001",
array:[
{sub_id:"1",sub_array:["text11","text12","text13"]},
{sub_id:"2",sub_array:["text21","text22","text23"]},
{sub_id:"3",sub_array:["text31","text32","text33"]}
]
}
直接向array中添加内容的话,很简单,利用$push操作符即可,
但如果我想往sub_id为2的sub_array中push若干个字符串,应该如何定位?
LEATH