I use this to destroy and create a fresh database for testing. Importing the views this way I can use my favourite editor and have prettify/beautify/linting/hinting on my map-reduce view functions instead of using the Futon editor.
Put all your view functions into:
- data/[designDoc]-[viewName].js (like
zdata users-index.js
) - data/index.js (like
zdata index.js
)
Use something like 0-setup.js
to import the views into your CouchDB.
Have fun.
A more complete solution is couchdb-bootstrap