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 "HttpViewApi" by ChrisAnderson
Date Wed, 28 May 2008 20:16:23 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:
http://wiki.apache.org/couchdb/HttpViewApi

The comment on the change is:
change map() to emit()

------------------------------------------------------------------------------
  
  {{{
  function(doc) {
-   map(null, doc);
+   emit(null, doc);
  }
  }}}
  
@@ -29, +29 @@

    "language": "text/javascript",
    "views":
    {
-     "all": "function(doc) { if (doc.Type == 'customer')  map(null, doc) }",
+     "all": "function(doc) { if (doc.Type == 'customer')  emit(null, doc) }",
-     "by_lastname": "function(doc) { if (doc.Type == 'customer')  map(doc.LastName, doc)
}"
+     "by_lastname": "function(doc) { if (doc.Type == 'customer')  emit(doc.LastName, doc)
}"
    }
  }
  }}}
@@ -108, +108 @@

  Date: Mon, 10 Sep 2007 17:11:10 +0200
  Content-Type: text/javascript
  
- function(doc) { if (doc.foo=='bar') { map(null, doc.foo); } }
+ function(doc) { if (doc.foo=='bar') { emit(null, doc.foo); } }
  }}}
  
  Could result in the following response:

Mime
View raw message