Search code examples
macoshttpcouchdbhttp-deletedata-persistence

Reset CouchDB completely


For the purposes of unit testing, I'd like to be able to completely remove documents and databases from a CouchDB instance running on my mac. Deleting the standard way isn't really a reset, which is not ideal for unit tests. I need to completely reset the environment.

I've found that deleting the ~/Library/Application Support/CouchDB directory resets the database to "Admin Party" and deletes all records, which is what I want. But, is there a cleaner, more flexible way to get a clean CouchDB instance on macOS?


Solution

    • Uninstall CouchDB
    • Delete all remaining files (including the data directory)
    • Install CouchDB

    This can be automated and is probably the best way to ensure a complete reset.