You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2009/01/04 02:10:55 UTC

[Couchdb Wiki] Update of "View Snippets" by ChrisAnderson

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 ChrisAnderson:
http://wiki.apache.org/couchdb/View_Snippets

The comment on the change is:
change temp_view to slow_view

------------------------------------------------------------------------------
  curl -s -i -X POST -H 'Content-Type: application/json' 
    -d '{"map": "function(doc){if(doc._attachments) {emit(\"with\",1);} else {emit(\"without\",1);}}", 
    "reduce": "function(keys, values) {return sum(values);}"}' 
-   'http://localhost:5984/somedb/_temp_view?group=true'
+   'http://localhost:5984/somedb/_slow_view?group=true'
  }}}
  
  In SQL this would be something along the lines of {{{SELECT num_attachments FROM table GROUP BY num_attachments}}} (but this would give extra output for rows containing more than one attachment).