我的 CouchDB 数据库中有以下文档:-
{
"_id": "c0d93b8f424037583b2fe71ea403044a",
"name": "Joe",
"country": "United Kingdom",
"email": "joe@acme.com"
}
{
"_id": "c0d93b8f424037583b2fe71ea403044d",
"name": "Joe",
"country": "United Kingdom",
"email": "joe@acme.com"
}
{
"_id": "c0d93b8f424037583b2fe71ea403044z",
"name": "Joe",
"country": "United Kingdom",
"email": "joe@acme.com"
}
{
"_id": "c0d93b8f424037583b2fe71ea403044x",
"name": "Fred",
"country": "France",
"email": "Fred@acme.com"
}
{
"_id": "c0d93b8f424037583b2fe71ea403044g",
"name": "Fred",
"country": "France",
"email": "Fred@acme.com"
}
{
"_id": "c0d93b8f424037583b2fe71ea403044p",
"name": "Bill",
"country": "Germany",
"email": "Bill@acme.com"
}
我想总结这些数据,以便可以根据国家/地区生成饼图,但我正在努力制定地图缩减代码以按国家/地区获取文档数。
有人可以帮我解释一下吗。
此致,
卡尔斯基