A small demo app that shows how you can do fun maintenance tasks with common UNIX tools.
Today curl
:
curl $COUCHDBDATABSE | curl -X POST $ANOTHERCOUCHDBDATABASE
The key is in lists/bulk_docs.js
; It transforms a view result into a JSON
object that the CouchDB _bulk_docs
API understands.
The rest of this app is just supporting the showcase:
views/all/map.js
is a sample view that just lists all documents._docs
are a bunch of example documents.bulk.sh
is a test script that shows how to invoke the mightycurl
.
Say you want to modify all your documents in one swoop:
- Write a view that emits a value with whatever your docs should look like.
- Add cccp’s list function to the database.
- Do the
curl | curl
dance and you’re done.
Let me know if you have other uses for this.
Jan Lehnardt jan@apache.org after an idea of Jason Smith jhs@couchone.com
MIT.