4.5. View recommendations

    It is possible to change the definition of a view, build the index, then make those changes go live without causing downtime for your application. The trick to making this work is that CouchDB’s JavaScript view index files are based on the contents of the design document - not its name, or revision. This means that two design documents with identical view code will share the same on-disk view index files.

    Here is a worked example, assuming your /db/_design/ddoc needs tobe updated.

    1. Upload the updated design doc to /db/_design/ddoc-new.

    The COPY HTTP verb can be used to copy the design document with a single command: