couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "View Snippets" by ChrisAnderson
Date Sat, 10 Jan 2009 19:50:15 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 ChrisAnderson:

The comment on the change is:
added super basic map view

  This page collects code snippets to be used in your ["Views"]. They are mainly ment to help
getting your head arround the map/reduce approach to databases. Keep in mind that the the
Futon Web-Client silently adds group=true to your views.
+ == Get docs with a particular user id
+ {{{
+ map: function(doc) {
+   if (doc.user_id) emit(doc.user_id, null)
+ }
+ }}}
+ Then query with key=USER_ID to get all the rows that match that user.
  == Get all documents which have an attatchment ==

View raw message