Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)copy! share!
posted at 30. Mar '18

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

Add Comment