1

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?

Luke Taylor
  • 8,631
  • 8
  • 54
  • 92
  • 1
    I would delete the files that are under the path in the configuration under "database_dir". But the database needs to be stopped before deletion and then started again afterwards. – pwagner Aug 14 '16 at 14:52

2 Answers2

2
  • 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.

Kul
  • 1,239
  • 8
  • 18
1

I was having trouble with it not starting at all running this in a console deleted all my data but got it going again

rm -rf ~/Library/Application Support/CouchDB2

Peter
  • 7,792
  • 9
  • 63
  • 94