How can I "undelete" a set of documents in CouchDB?

Posted by radicand on Stack Overflow See other posts from Stack Overflow or by radicand
Published on 2012-06-25T17:22:20Z Indexed on 2012/06/26 3:16 UTC
Read the original article Hit count: 107

Filed under:

I have a large set of documents in a CouchDB database that were just accidentally bulk deleted using _deleted:true. I also have a backup for this set of data that includes their last known good revision and metadata. I need to maintain the same _id, so simple restore with a new _id is not an option.

Compaction has not been run and I can access any of these documents via the &rev= url parameter as well as their attachments (which are needed).

What I need to do is "restore" these documents to the revision I have on file. Surprisingly, I have come up empty with any queries on how to achieve this. Tips or hacks appreciated.

© Stack Overflow or respective owner

Related posts about couchdb