couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Re: Incremental map/reduce
Date Fri, 30 Jan 2009 15:09:29 GMT
On Fri, Jan 30, 2009 at 03:17:58PM +0100, Patrick Antivackis wrote:
> normally in your view if you add a reduce=false parameter you should only
> get the map

That's exactly what I was thinking of, and I have no idea why I overlooked
this parameter on the wiki :-) Thanks for putting me straight.

I have one, teeny suggestion. I notice that couchdb does insert newlines in
its JSON sometimes, e.g.

$ curl 'http://127.0.0.1:5984/maptest/_view/test/sum?reduce=false'
{"total_rows":9,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":1},
{"id":"doc1","key":"doc1","value":2},
{"id":"doc3","key":"doc3","value":3},
{"id":"doc3","key":"doc3","value":4},
{"id":"doc3","key":"doc3","value":5},
{"id":"doc4","key":"doc4","value":6},
{"id":"doc4","key":"doc4","value":7},
{"id":"doc5","key":"doc5","value":8},
{"id":"doc6","key":"doc6","value":9}
]}$ 

But not in others:

$ curl 'http://127.0.0.1:54/maptest/_view/test/sum?group=true'
{"rows":[{"key":"doc1","value":3},{"key":"doc3","value":12},{"key":"doc4","value":13},{"key":"doc5","value":8},{"key":"doc6","value":9}]}$


What I'd really like is for it to send a single newline at the end of the
entire response, so that curl output terminates nicely with my shell prompt
on a new line. Would this be considered an excessive waste of bandwidth? :-)

Cheers,

Brian.

Mime
View raw message