couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Klo <>
Subject Re: purging documents?
Date Fri, 18 May 2012 18:02:39 GMT
Not sure how many docs you have, but can you filter replicate the good docs into a new db?

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International

On May 18, 2012, at 10:39 AM, Tim Tisdall wrote:

> After further reading it seems like I could use _purge ...  However, I
> still need to query the DB to fetch all the revisions.
> On Fri, May 18, 2012 at 12:12 PM, Tim Tisdall <> wrote:
>> I accidentally created several million documents in my DB which I'd like
>> to undo.  ^_^  I know I can query each document to get the revision and
>> then issue a DELETE, but that seems like a lot of additional work.  Also,
>> the wiki says "Deleted documents remain in the database forever, even after
>> compaction, to allow eventual consistency when replicating." and that's a
>> lot of dead space.  Is there a way that I can purge all of those documents
>> given that I have the _ids that they were saved under?  I essentially would
>> like to return the DB to a state before I inserted all of those documents.
>> I'm also going to be inserting updated documents to the DB with those same
>> _ids, so another alternative is to post updates to each (but that would
>> also require getting the revision ids) and then clearing out old revisions.
>> However, this would require fetching several million revision ids and then
>> figuring out how to force the DB to clear out all old revisions.
>> -Tim

View raw message