Command-line tools to operate with JSON files in sync with CouchDB
npm install -g couchdocs
Optional file with name .couchdocs contains properties of CouchDB connection which should be applied for sync of JSON files in the current folder.
[couchdb]
db=testdb
url=http://localhost:5984/
You could also use COUCH_URL and COUCH_DB variables too for database specification.
url is optional, http://localhost:5984/ is used by default, but you typically must specify db parameter for simplifying operations
Use -v to have a verbose output about what is going on.
couchdocs create
couchdocs create http://example.com/database.tar.gz
couchdocs recreate
couchdocs recreate http://example.com/database.tar.gz
couchdocs update foo.json
couchdocs update --id _design/backend design_backend.json
Read section in couchdocs file, it can declare what exact types or what documents can be safely autoupdated.
[autoupdate] section can contain types that should be auto updated.
[exclude] section can contain documents that should be auto updated.
couchdocs autoupdate
couchdocs autoupdate http://example.com/database.tar.gz
Typical Example of couchdocs sections for configuring autoupdates
[autoupdate]
_id=_design/servers _design/public _design/auth
type=template layout widget webapp-config
[exclude]
_id=User-Backup
Each document becomes a separate file
couchdocs save
couchdocs zip
Each database would be saved as compressed .tar.gz file. couchbackup will be salled, so it should be installed for that operation
couchdocs backup
Issues.Other useful CLI utilities:
Content type
Image
Digest
Size
32.8 MB
Last updated
almost 6 years ago
docker pull wcrbrm/couchdocs