Skip to content

Instantly share code, notes, and snippets.

@davisp
Created January 12, 2012 22:40
Show Gist options
  • Save davisp/1603604 to your computer and use it in GitHub Desktop.
Save davisp/1603604 to your computer and use it in GitHub Desktop.
{"ok":true}
{"ok":true}
{"ok":true,"id":"bar","rev":"1-967a00dff5e02add41819138abb3284d"}
{"ok":true,"id":"bar","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}
{"ok":true,"id":"bar","rev":"3-7379b9e515b161226c6559d90c4dc49f"}
{"ok":true,"id":"bar","rev":"4-2c32ffda5905fe770af07314d0a4f93e"}
#!/bin/sh
CURL="curl"
JSON_HEADER="-H Content-Type:application/json"
REV1="1-967a00dff5e02add41819138abb3284d"
REV2="2-7051cbe5c8faecd085a3fa619e6e6337"
$CURL -X DELETE http://127.0.0.1:5984/foo
$CURL -X PUT http://127.0.0.1:5984/foo
$CURL -X PUT $JSON_HEADER http://127.0.0.1:5984/foo/bar \
-d '{}'
$CURL -X PUT $JSON_HEADER http://127.0.0.1:5984/foo/bar \
-d '{"_rev": "1-967a00dff5e02add41819138abb3284d"}'
$CURL -X DELETE $JSON_HEADER http://127.0.0.1:5984/foo/bar?rev=$REV2
$CURL -X POST $JSON_HEADER http://127.0.0.1:5984/foo/_compact
sleep 1
$CURL -X PUT $JSON_HEADER http://127.0.0.1:5984/foo/bar \
-d '{}'
#-d '{"_rev": "1-967a00dff5e02add41819138abb3284d"}'
{"ok":true}
{"ok":true}
{"ok":true,"id":"bar","rev":"1-967a00dff5e02add41819138abb3284d"}
{"ok":true,"id":"bar","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}
{"ok":true,"id":"bar","rev":"3-7379b9e515b161226c6559d90c4dc49f"}
{"ok":true}
{"ok":true,"id":"bar","rev":"1-967a00dff5e02add41819138abb3284d"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment