To copy the latest version of a design document to a new document you specify the base document and target document:
COPY http://couchdb:5984/recipes/_design/recipes Content-Type: application/json Destination: /recipes/_design/recipelist
The above request copies the design document
recipes
to the new design document
recipelist
. The response is the ID and
revision of the new document.
{ "id" : "recipes/_design/recipelist" "rev" : "1-9c65296036141e575d32ba9c034dd3ee", }
Copying a design document does automatically reconstruct the view indexes. These will be recreated, as with other views, the first time the new view is accessed.