incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Ollie <j...@ocjtech.us>
Subject Problem using Views
Date Wed, 17 Mar 2010 17:31:50 GMT
Hello,

I am trying to use a view in a project, but I'm not having much luck.
I'm using the following as my map function:

function(doc) {
 if (doc.record_type ==
"http://www.geocaching.com/track/details.aspx" && !(typeof
doc.location === "undefined")) {
   emit(doc.location, null);
 }
}

In my code I do the following:

results = database.execute_view('trackables_by_location', 'geocaching')

and then pretty much any usage of "results" gives me a
"httplib.BadStatusLine" exception because the CouchDB server seems to
be cutting off the HTTP connection without returning any headers or
data.  I've attached the logs from an attempt and it looks like the
error message on the server side is "Cannot encode 'undefined' value
as JSON".  Checking the FAQ for that error message pointed me to map
functions emtting undefined values, but I think I have that taken care
of.  The only other oddness is that there
aren't any records in the database that would be in the view at the
time I'm executing the query.

I'm pretty new to the CouchDB scene so I'm pretty sure I'm doing
something wrong, I just can't figure out *what*.  I'm using
desktopcouch 0.6.3, python-couchdb 0.6.1, couchdb 0.10.1, and erlang
R13B-04 on Fedora 12.

--
Jeff Ollie

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message