couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Sneeringer <>
Subject No safe way to query and not ever reduce a view.
Date Thu, 10 Dec 2009 15:27:37 GMT
So I'm in a situation here, and perhaps I'm missing something obvious.

I have four views. They work fine. Two of them have reduce functions, and two of them don't.
On views with a reduce function, CouchDB sends reduced replies unless you specifically tell
it not to. Anyway, in this particular instance, I want to query a view that may or may not
have a reduce function, but I want the non-reduced results.

This seems simple enough...just add ?reduce=false. However, if you send ?reduce=false to a
map-only view, you get an error from CouchDB. I also can find no way to ask if a view is a
map-view or a map-reduce-view. In other words, if I have a view that may or may not have a
reduce function, the only way I can see to get non-reduced results is to send a request with
?reduce=false, catch the exception that's raised if it was a map-only view, and send the query
again without ?reduce=false.

This feels quite clunky to me and not at all relaxing. I understand the strict error checking,
but I suppose it seems there should either be a salient way to see which request form I should
use, or there should be a request form that works in both cases? If I don't want reduced results,
after all, it shouldn't matter if I have a reduce function.

Which brings me to the mailing list. Am I missing something? I looked in the manual, and found
nothing. Is this in CouchDB? If so, how do I do it?

Best Regards,
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message