Skip to content

Instantly share code, notes, and snippets.

@hideki
Created November 12, 2015 01:42
Show Gist options
  • Save hideki/823c1c02157a3f9f1b2f to your computer and use it in GitHub Desktop.
Save hideki/823c1c02157a3f9f1b2f to your computer and use it in GitHub Desktop.
deletedb:
curl -X DELETE http://192.168.57.101:5984/db/
putdb:
curl -X PUT http://192.168.57.101:5984/db/
getdb:
curl -X GET http://192.168.57.101:5984/db/
pullrepl:
curl -X POST -H "Content-type: application/json" http://192.168.57.101:5984/_replicate --data '{"continuous":true, "source":"db","target":"http://10.17.2.82:4984/db"}'
pushrepl:
curl -X POST -H "Content-type: application/json" http://192.168.57.101:5984/_replicate --data '{"continuous":true, "target":"db","source":"http://10.17.2.82:4984/db"}'
activetask:
curl -X GET http://192.168.57.101:5984/_active_tasks
doc1:
curl -X POST -H "Content-type: application/json" http://192.168.57.101:5984/db/ --data '{"type":"order","SeatNumber":"10"}'
doc2:
curl -X POST -H "Content-type: application/json" http://192.168.57.101:5984/db/ --data '{"type":"user","Name":"tom"}'
doc3:
curl -X POST -H "Content-type: application/json" http://192.168.57.101:5984/db/ --data '{"type":"user","Name":"ABC"}'
changes1:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=0"
changes2:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=1"
changes3:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=2"
changes4:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=3"
changes5:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=4"
changes6:
curl -X GET "http://192.168.57.101:5984/db/_changes?feed=longpoll&include_docs=true&since=5"
sgdb:
curl -X GET http://10.17.2.82:4984/db/
sgdoc1:
curl -X POST -H "Content-type: application/json" http://10.17.2.82:4984/db/ --data '{"type":"order","SeatNumber":"10"}'
sgdoc2:
curl -X POST -H "Content-type: application/json" http://10.17.2.82:4984/db/ --data '{"type":"user","Name":"tom"}'
sgdoc3:
curl -X POST -H "Content-type: application/json" http://10.17.2.82:4984/db/ --data '{"type":"user","Name":"ABC"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment