我有一个这样的文档结构:
[{
name: "Something",
codes: [
{type: 11},
{type: 11},
{type: 15}
]
},
{
name: "Another",
codes: [
{type: 11},
{type: 12},
{type: 15},
{type: 11}
]
}]]
我需要在收藏中每个条目中计算 type = 11
出现的次数。但我卡住了。