I have this simple map/reduce function in my CouchDB. This one maps
function(doc) {
emit(doc.Retweeted_user, 1);
emit(doc.User, 1);
}
And this one reduces
function( keys,values ) {
return sum( values );
}
It’s saved as users/howmany. I’m using this for making the query
curl -X GET 'http://localhost:5984/test20n/_design/users/_view/how_many'
But this replies
curl: (52) Empty reply from server
And if I try other things, like,
curl -X GET 'http://localhost:5984/test20n/_design/users/_view/how_many?group="true"'
I get exactly the same answer. What kind of URL magic is needed here?
This happened for version 0.10.0, the one that gets installed in Ubuntu 10.04. I have tried now with 1.0.1, And it works perfectly, so maybe it was an error that was fixed.
You said you saved it as count/howmany but the word ‘count’ appears nowhere in your url, so you should be getting a 404. You might mean;
or
depending on whether ‘count’ was your design document name or part of the view name.
As to why you get that strange curl error, I can’t explain it, but if you run the following command and paste the full results (omitting any Authorization header), I can help;
http://wiki.apache.org/couchdb/HTTP_view_API