CouchDB and PHP Web Development Beginner’s Guide
上QQ阅读APP看书,第一时间看更新

Time for action — deleting a database In CouchDB

In this exercise, we'll call a DELETE request to delete the another-db database.

  1. Delete another-db by running the following command in Terminal:
    curl -X DELETE http://localhost:5984/another-db 
    
  2. Terminal will respond with the following:
    {"ok":true} 
    

What just happened?

We used Terminal to trigger a DELETE method to CouchDB's RESTful JSON API. We passed the name of the database that we wanted to delete, another-db, at the end of the root URL. When the database was successfully deleted, we received a message that everything went okay.