couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: view question
Date Tue, 08 Jul 2008 11:44:42 GMT

On Jul 8, 2008, at 13:17, Paul Oliver wrote:

> Hi all,
>
> I'm trying to get a simple view going.  Can anybody tell me what I'm
> doing wrong here?  I'm using Apache CouchDB 0.8.0-incubating.
>
> altais:~$ curl  -H 'Content-Type:application/json' --data
> 'function(doc) { emit(null, doc); }'
> http://localhost:5984/mydb/_temp_view
>
> returns:
>
> {"error":"EXIT","reason":"{function_clause,[{cjson,tokenize,\n
>                [\"function(doc) { emit(null, doc); }\",\n
>             {decoder,unicode,null,1,1,any}]},\n
> {cjson,decode1,2},\n                  {cjson,json_decode,2},\n
>         {couch_httpd,handle_db_request,3},\n
> {couch_httpd,handle_request,2},\n
> {mochiweb_http,headers,4},\n                  {proc_lib,init_p,5}]}"}
>

You now longer just send the map function code, you need
to send a proper JSON object see "Ad Hoc Views" at
http://wiki.apache.org/couchdb/HttpViewApi and "View Definition
Changes" at http://wiki.apache.org/couchdb/BreakingChanges

Cheers
Jan
--

Mime
View raw message