incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: copy docs from one db to another?
Date Mon, 25 Mar 2013 21:50:07 GMT
If I'm not mistaken, that's exactly what Mark is asking about.

Yes, you can GET and PUT documents as a copy mechanism. That's all the
replicator does, after all.

B.

On 25 March 2013 21:46, Jens Alfke <jens@couchbase.com> wrote:
>
> On Mar 25, 2013, at 2:35 PM, Mark Hahn <mark@hahnca.com<mailto:mark@hahnca.com>>
wrote:
>
> 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.
>
> —Jens

Mime
View raw message