couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: copy docs from one db to another?
Date Mon, 25 Mar 2013 21:46:21 GMT

On Mar 25, 2013, at 2:35 PM, Mark Hahn <<>>

I have a database with a zillion docs that I need to empty.  I just want
the design docs left behind.

If you delete the docs, you’ll leave behind tombstone revisions, so the database won’t
strictly speaking be empty (unless you call purge afterwards.)

 I googled and saw some techniques that
require writing code.
Could I just GET the docs with curl and then PUT them?

The fastest way is probably
1. Create a new database
2. GET the design docs, PUT them to the new database
3. Delete the old database
However you’ll be left with a database with a different name. I don’t think there is any
API to rename a database.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message