couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "View Snippets" by WoutMertens
Date Sun, 12 Apr 2009 07:23:43 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by WoutMertens:
http://wiki.apache.org/couchdb/View_Snippets

The comment on the change is:
group_level example

------------------------------------------------------------------------------
  ]}
  }}}
  
- You can then get all the rows for the key "thisparent" with the view parameters ''startkey=["thisparent"]&endkey=["thisparent",{}]&inclusive_end=false''.
+ You can then get all the rows for the key ''"thisparent"'' with the view parameters ''startkey=[''''''"thisparent"]&endkey=["thisparent",{}]&inclusive_end=false''
  
  Note that the trick here is using the key for what you want to make unique. You can combine
this with the counting above to get a count of duplicate values:
  
@@ -97, +97 @@

     return sum(values);
  }
  }}}
+ 
+ If you then want to know the total count for each parent, you can use the ''group_level''
view parameter:
+ ''startkey=[''''''"thisparent"]&endkey=["thisparent",{}]&inclusive_end=false&group_level=1''
  
  == Retrieve the top N tags. ==
  

Mime
View raw message