published at 2014-12-03
created at 2013
written by Ivan Alenko

CouchDB 1.x Notes

Replication

from localhost to remote via SSH tunnel

curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d ' {"source": "http://localhost:5984/avalon", "target": "http://localhost:8080/avalon", "create_target": true} '

from remote to localhost via SSH tunnel

 curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d ' {"source": "http://localhost:8080/avalon", "target": "http://localhost:5984/avalon", "create_target": true}'

Bug in CouchDB 1.4 and Debian

An old bug from 2013.

hrdina@witch:~$ curl http://localhost:5984/avalon/_design/doublemindcouch/_view/page_by_uri?key=hello
{"error":"bad_request","reason":"invalid_json"}

Calling API by hand with curl

TODO check this

curl -X POST http://localhost:5984/avalon -d '{"hello": "world"}' -H "Content-Type: application/json" http://localhost:5984/avalon/_design/doublemindcouch/_view/page_by_uri?key=%22a%22

curl -X GET http://localhost:5984/avalon -H "Content-Type: application/json" http://localhost:5984/avalon/_design/doublemindcouch/_view/page_by_uri?key=%22hello%22&limit=1&include_docs=true