couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: CouchDB: JSON Callback
Date Tue, 30 Jul 2013 09:19:15 GMT
Enable JSONP (http://docs.couchdb.org/en/latest/config_reference.html#httpd-configuration-options)
and then add ?callback=foo. couchdb will then return foo({"rows"... );

I failed to find a write-up of JSONP in our manual or even a mention
on the wiki, sorry about that.

B.


On 30 July 2013 01:06, Hank Knight <hknight555@gmail.com> wrote:
> Results are returned in JSON format:
> https://zurv3aqzm.iriscouch.com/fruit/_design/zzz6/_view/zzz6?limit=101&group=true
>
> Is there a way to wrap the JSON in a way that could be used for a callback?
>
> Like this:
>
> xyz({"rows":[
> {"key":"blueberry","value":1},
> {"key":"cranberry","value":1},
> {"key":"gooseberry","value":3},
> {"key":"grapefruit","value":2},
> {"key":"lemon","value":1},
> {"key":"lime","value":1},
> {"key":"orange","value":1},
> {"key":"peach","value":2},
> {"key":"plumb","value":1},
> {"key":"strawberry","value":4},
> {"key":"watermelon","value":2}
> ]})

Mime
View raw message