couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: url rewriting & view update
Date Wed, 31 Mar 2010 11:46:52 GMT
Deploying a new design document, with the updated view functions,
building the views, and then using HTTP COPY to copy the new design
document over the old one, allows for this already, regardless of
whether you use URL rewriting.

curl http://localhost:5984/db5/_design/foo -X PUT -d '{}'
curl http://localhost:5984/db5/_design/bar -X PUT -d '{}'

foo is current ddoc, bar is the new one.

curl http://localhost:5984/db5/_design/bar -X COPY -H "Destination:

_design/foo is atomically updated to be the same as _design/bar, so
any queries going to _design/foo are suddenly using the new index.


On Wed, Mar 31, 2010 at 11:36 AM, Fabio Forno <> wrote:
> Hi, I'm reading the nice new features of couchdb 0.11 and I'm
> wondering if url rewriting can be used for making it easier to update
> views in web applications. One problem we usually have is that when we
> change a view all the map/reduce must be recomputed, thus making it
> unaccessible from the web interface fro a while. The only way we know
> for a smooth transition is to make a new view and, when recomputed, we
> point the code to it. It would be much easier to be able to do the
> same thing with url rewriting, but since mappings are written in the
> design doc itself I fear that if we change something the view is
> recalculated nevertheless. Could it work or there are ways to do the
> same thing?
> bye
> --
> Fabio Forno,
> Ooros srl
> jabber id:

View raw message