CouchDB quick ref/starting guide
GUI (Futon). From the browser go to http://127.0.0.1:5984/_utils
List all DB's
$ curl -X GET http://127.0.0.1:5984/_all_dbsCreate DB
$ curl -X PUT http://127.0.0.1:5984/contactsDelete DB
$ curl -X DELETE http://127.0.0.1:5984/contactsInsert document (record)
$ curl -X put http://127.0.0.1:5984/contacts/andyjarrett -d '{"firstName":"Andy","lastName":"Jarrett","email":"[email protected]"}' Using the -d flag, it is recommended that you encapsulate your JSON code using single quotes rather than double quoteGet documents
$ curl -X GET http://127.0.0.1:5984/contacts/andyjarrettDelete document
$ curl -X DELETE http://127.0.0.1:5984/contacts/johndoe?rev={USE REV FROM THE GET RECORD COMMAND}Copy record (document)
$ curl -X COPY http://127.0.0.1:5984/contacts/andyjarrett -H "Destination: tylerdurden"Update record (document): You'll need the rev number which the GET record command can supply.
$ curl -X PUT http://127.0.0.1:5984/contacts/tylerdurden -d '{"_rev":"1-b2a7c335ac3e754f050eda2baff6bf89","firstName":"Tyler","lastName":"Durden","email":["[email protected]","[email protected]"]}List all documents
$ curl -X GET http://127.0.0.1:5984/contacts/_all_docsList all documents (ORDER and set LIMIT)
$ curl -X GET http://127.0.0.1:5984/contacts/_all_docs?descending=true\\&limit=1All documents in the DB (as well as deleted ones) ordered by last modified. Look for the following next to deleted records: "deleted":true
$ curl -X GET http://127.0.0.1:5984/contacts/_all_docs_by_seq