[clouchdb-devel] ad-hoc view problem

Kevin Raison raison at chatsubo.net
Wed Aug 24 00:12:49 UTC 2011


I am just getting started with clouchdb and have hit a snag;  I cannot 
seem to get ad-hoc views to work properly.  With a function definition 
like so (or the equivalent in parenscript):

(ad-hoc-view "function(doc) { if (doc.TYPE == 'snippet') { 
map(null,doc.SNIPPET) } }")

I get an error:
((:|error| . "bad_request") (:|reason| . "invalid UTF-8 JSON"))

And I see this in the couchdb logs:
  [error] [<0.16308.73>] attempted upload of invalid JSON function(doc) 
{ if (doc.TYPE == 'snippet') { map(null,doc.SNIPPET) } }

I am using couchdb version 0.10.0.  Is this a known issue?  Any suggestions?

Thanks,
Kevin




More information about the clouchdb-devel mailing list