2015-06-14 43 views
0

我是CouchDB的新手。我有一个9 GB的数据集加载到我的couchdb中。我能够正确地映射一切。但是我无法使用reduce列中编写的代码来减少任何结果。当我尝试登录时,日志显示rereduce值为false。在做Map()或者如何设置rereduce值为TRUE时,我是否需要做特别的事情?CouchDB - 为什么我的回归总是会出现错误?我无法正确减少任何东西

我的数据的样品如下:

{ 
    "_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个结果

我想用下面的功能在减少标签数: 减少: _count或_sum

它不会给出单个的四舍五入值。即使我不能得到简单的_count操作正确! :(

的截图,http://s11.postimg.org/lz9ilzhtf/image.png

请帮帮我!

回答

0

你得到了什么是每标题值的总和。你想要什么,这个值的总和一般

更改grouping下拉列表none

检查CouchdDB's wiki了解更多关于分组的细节。

+0

感谢您的回答。我现在明白了:) – ars1989

相关问题