CouchDB-为什么我的 reduce 总是以 false 出现?我无法正确减少任何东西
CouchDB-Why my rerduce is always coming as false ? I am not able to reduce anything properly
我是 CouchDB 的新手。我有一个 9 GB 的数据集加载到我的 couchdb 中。我能够正确映射所有内容。但是我无法使用 reduce 列中编写的代码来减少任何结果。当我尝试记录时,记录显示重新减少值为 false。在执行 Map() 时我需要做任何特殊的事情吗?或者如何将 rereduce 值设置为 TRUE?
我的数据样本如下:
{
"_id": "33d4d945613344f13a3ee92933b160bf",
"_rev": "1-0425ca93e3aa939dff46dd51c3ab86f2",
"release": {
"genres": {
"genre": "Electronic"
},
"status": "Accepted",
"videos": {
"video": [
{
"title": "[1995] bola - krak jakomo",
"duration": 349,
"description": "[1995] bola - krak jakomo",
"src": "http://www.youtube.com/watch?v=KrELXoYThpI",
"embed": true
},
{
"title": "Bola - Forcasa 3",
"duration": 325,
"description": "Bola - Forcasa 3",
"src": "http://www.youtube.com/watch?v=Lz9itUo5xtc",
"embed": true
},
{
"title": "Bola (Darrell Fitton) - Metalurg (MV)",
"duration": 439,
"description": "Bola (Darrell Fitton) - Metalurg (MV)",
"src": "http://www.youtube.com/watch?v=_MYpOOMRAeQ",
"embed": true
}
]
},
"labels": {
"label": {
"catno": "SKA005",
"name": "Skam"
}
},
"companies": "",
"styles": {
"style": [
"Downtempo",
"Experimental",
"Ambient"
]
},
"formats": {
"format": {
"text": "",
"name": "Vinyl",
"qty": 1,
"descriptions": {
"description": [
"12\"",
"Limited Edition",
"33 ⅓ RPM"
]
}
}
},
"country": "UK",
"id": 1928,
"released": "1995-00-00",
"artists": {
"artist": {
"id": 390,
"anv": "",
"name": "Bola",
"role": "",
"tracks": "",
"join": ""
}
},
"title": 1,
"master_id": 13562,
"tracklist": {
"track": [
{
"position": "A1",
"duration": "4:33",
"title": "Forcasa 3"
},
{
"position": "A2",
"duration": "5:48",
"title": "Krak Jakomo"
},
{
"position": "B1",
"duration": "7:50",
"title": "Metalurg 2"
},
{
"position": "B2",
"duration": "6:40",
"title": "Balloom"
}
]
},
"data_quality": "Correct",
"extraartists": {
"artist": {
"id": 388200,
"anv": "",
"name": "Paul Solomons",
"role": "Mastered By",
"tracks": "",
"join": ""
}
},
"notes": "Limited to 480 copies.\nA1 is a shorter version than that found on the 'Soup' LP.\nA2 ends in a lock groove."
}
}
我的目的是计算映射值。我的映射函数如下:
function(doc){
if(doc.release)
emit(doc.release.title,1)
}
地图结果显示大约 5800 个结果
我想在reduce标签中使用以下函数来统计:
减少:
_count 或 _sum
它不给出单舍入值。即使我无法正确执行简单的 _count 操作!!! :(
截图,
请帮帮我!!!
您得到的是每个标题值的总和。您想要的是一般值 .
的总和
将 grouping
drop-down 列表更改为 none
。
查看 CouchdDB's wiki 了解有关分组的更多详细信息。
我是 CouchDB 的新手。我有一个 9 GB 的数据集加载到我的 couchdb 中。我能够正确映射所有内容。但是我无法使用 reduce 列中编写的代码来减少任何结果。当我尝试记录时,记录显示重新减少值为 false。在执行 Map() 时我需要做任何特殊的事情吗?或者如何将 rereduce 值设置为 TRUE?
我的数据样本如下:
{
"_id": "33d4d945613344f13a3ee92933b160bf",
"_rev": "1-0425ca93e3aa939dff46dd51c3ab86f2",
"release": {
"genres": {
"genre": "Electronic"
},
"status": "Accepted",
"videos": {
"video": [
{
"title": "[1995] bola - krak jakomo",
"duration": 349,
"description": "[1995] bola - krak jakomo",
"src": "http://www.youtube.com/watch?v=KrELXoYThpI",
"embed": true
},
{
"title": "Bola - Forcasa 3",
"duration": 325,
"description": "Bola - Forcasa 3",
"src": "http://www.youtube.com/watch?v=Lz9itUo5xtc",
"embed": true
},
{
"title": "Bola (Darrell Fitton) - Metalurg (MV)",
"duration": 439,
"description": "Bola (Darrell Fitton) - Metalurg (MV)",
"src": "http://www.youtube.com/watch?v=_MYpOOMRAeQ",
"embed": true
}
]
},
"labels": {
"label": {
"catno": "SKA005",
"name": "Skam"
}
},
"companies": "",
"styles": {
"style": [
"Downtempo",
"Experimental",
"Ambient"
]
},
"formats": {
"format": {
"text": "",
"name": "Vinyl",
"qty": 1,
"descriptions": {
"description": [
"12\"",
"Limited Edition",
"33 ⅓ RPM"
]
}
}
},
"country": "UK",
"id": 1928,
"released": "1995-00-00",
"artists": {
"artist": {
"id": 390,
"anv": "",
"name": "Bola",
"role": "",
"tracks": "",
"join": ""
}
},
"title": 1,
"master_id": 13562,
"tracklist": {
"track": [
{
"position": "A1",
"duration": "4:33",
"title": "Forcasa 3"
},
{
"position": "A2",
"duration": "5:48",
"title": "Krak Jakomo"
},
{
"position": "B1",
"duration": "7:50",
"title": "Metalurg 2"
},
{
"position": "B2",
"duration": "6:40",
"title": "Balloom"
}
]
},
"data_quality": "Correct",
"extraartists": {
"artist": {
"id": 388200,
"anv": "",
"name": "Paul Solomons",
"role": "Mastered By",
"tracks": "",
"join": ""
}
},
"notes": "Limited to 480 copies.\nA1 is a shorter version than that found on the 'Soup' LP.\nA2 ends in a lock groove."
}
}
我的目的是计算映射值。我的映射函数如下:
function(doc){
if(doc.release)
emit(doc.release.title,1)
}
地图结果显示大约 5800 个结果
我想在reduce标签中使用以下函数来统计: 减少: _count 或 _sum
它不给出单舍入值。即使我无法正确执行简单的 _count 操作!!! :(
截图,
请帮帮我!!!
您得到的是每个标题值的总和。您想要的是一般值 .
的总和将 grouping
drop-down 列表更改为 none
。
查看 CouchdDB's wiki 了解有关分组的更多详细信息。