Hi everyone,

I know there is outdated info in CouchDB Wiki and, therefore, for the
beginners like me here is a piece of misleading info and how its solution.
Maybe someone is interested.

I was playing with the list functions and I noticed that on the page

http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Listing_Views_with_CouchDB_0.10_and_later

the view functions are constructed without map key (perhaps being
considered as the only functions, so, omitting that key). If one tries
those examples, he/she will get the "function_clause" error (in lists:foldl
from couch_view_group). Instead, those view functions should be written as:

"views" {
        "posts-by-date": {"map": "function(doc){ /*...*/ }"},
        "posts-by-tag": {"map": "function(doc){ /*...*/ }"},
        "people-by-name": {"map": "function(doc) { /*...*/ }"}
 }

My CouchDB version is 1.1.0 (so, perhaps the later versions will report the
same problem).

Cheers,
CGS

Reply via email to