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 "ViewCollation" by JacintoShy
Date Tue, 10 Jun 2008 12:05:58 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 JacintoShy:
http://wiki.apache.org/couchdb/ViewCollation

The comment on the change is:
map -> emit

------------------------------------------------------------------------------
  {{{
  function(doc) {
    if (doc.Type == "customer") {
-     map(doc.LastName, {FirstName: doc.FirstName, Address: doc.Address});
+     emit(doc.LastName, {FirstName: doc.FirstName, Address: doc.Address});
    }
  }
  }}}
@@ -23, +23 @@

  {{{
  function(doc) {
    if (doc.Type == "customer") {
-     map([doc._id, 0], doc);
+     emit([doc._id, 0], doc);
    } else if (doc.Type == "order") {
-     map([doc.customer_id, 1], doc);
+     emit([doc.customer_id, 1], doc);
    }
  }
  }}}

Mime
View raw message