couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niket Patel <nex...@me.com>
Subject Re: Incremental map/reduce
Date Fri, 30 Jan 2009 15:26:25 GMT
Brian,

http://couchdb.markmail.org/message/hn6k7qxc62r2whtf
It have script in python and ruby to get pretty output form curl

and about \n at end of response also discussed previously  
aggressively :-)
just for nice curl output things should not be changed but it is  
personal preference

- NIket

On Jan 30, 2009, at 8:39 PM, Brian Candler wrote:

> 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