Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Developer Guide 2.0
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
9.7 Design Document REST API
Chapter Sections
Chapters

9.7.3. Deleting a Design Document

To delete a design document, you use the DELETE HTTP request with the URL of the corresponding design document. The summary information for this request is shown in the table below:

MethodDELETE /bucket/_design/design-doc
Request DataDesign document definition (JSON)
Response DataSuccess and confirmed design document ID
Authentication Requiredoptional
Return Codes 
200Request completed successfully.
401The item requested was not available using the supplied authorization, or authorization was not supplied.
404The requested content could not be found. The returned content will include further information, as a JSON object, if available.

Deleting a design document immediately invalidates the design document and all views and indexes associated with it. The indexes and stored data on disk are removed in the background.

For example, to delete the previously created design document using curl:

shell> curl -v -X DELETE -H 'Content-Type: application/json' \
    'http://Administrator:Password@192.168.0.77:8092/default/_design/dev_byfield'

When the design document has been successfully removed, the JSON returned indidicates successful completion, and confirmation of the design document removed:

JSON
{"ok":true,"id":"_design/dev_byfield"}

Error conditions will be returned if the authorization is incorrect, or the specified design document cannot be found.