我有以下文档结构:
{
"country_id" : 328,
"country_name" : "Australien",
"cities" : [{
"city_id" : 19398,
"city_name" : "Bondi Beach (Sydney)"
}, {
"city_id" : 31102,
"city_name" : "Double Bay (Sydney)"
}, {
"city_id" : 31101,
"city_name" : "Rushcutters Bay (Sydney)"
}, {
"city_id" : 817,
"city_name" : "Sydney"
}, {
"city_id" : 31022,
"city_name" : "Wolly Creek (Sydney)"
}, {
"city_id" : 18851,
"city_name" : "Woollahra"
}],
"regions" : {
"region_id" : 796,
"region_name" : "Australien: New South Wales (Sydney)"
}
}
对于多面导航,我想计算属性 country_id、citys.city_id、regions_region_id 我想我可以使用 map/reduce 来做到这一点。
对于给定的结构,这可能吗?
也许有人可以指出我正确的地图/减少方向。