couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: HTTP request with CouchDB
Date Wed, 13 Nov 2013 12:57:17 GMT
On 13. November 2013 at 13:49:12, Hank Knight (hknight555@gmail.com) wrote:
>  
> Is it possible to send an HTTP request and receive a result with  
> CouchDB?

Inside view/show/list/filters , no. They’re sandboxed to prevent this.

> I would like to do something like this:
>  
>  
> function(doc, req) {
> var http = new XMLHttpRequest();
> http.open( "GET", "http://abomination-deleted.xml",  
> false );
> http.send( null );
> emit("xyz",http.responseText);
> }

The reason is that each doc should be idempotent; if you can mix into your view external results
then CouchDB can’t guarantee that fun(x) always produces the same x’ as result.

A+
Dave


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