1

I have deleted documents by mistake in Cloudant but can't find a way to retrieve them. I have followed this tuto: http://garmoncheg.blogspot.com/2013/11/couchdb-restoring-deletedupdated.html

And this answer: Retrieve just deleted document

Without success... What is the normal procedure? Each time I try to get a specific revision of deleted document: https://address/mydb/$id?rev=$rev I get only a partial document

Nate
  • 7,606
  • 23
  • 72
  • 124

1 Answers1

1

If you're quick, you can retrieve the body of a recently deleted document with GET /mydb/id?rev=x where x is the old revision number. But periodically Cloudant (and CouchDB) performs a "compaction" operation that removes the bodies of older revisions that are no longer required. That would leave older document with only its _id, _rev and _deleted=true, which is, I suspect, what you are seeing.

Glynn Bird
  • 5,507
  • 2
  • 12
  • 21
  • I think this is a good answer, but I'll point out it's really a side effect of using the `DELETE` method, which is what "clears out" the final revision that remains. If you save a doc with `"_deleted": true` instead, you can actually leave other fields in that "final revision" and they won't get compacted away. (I explain more at http://n.exts.ch/2012/11/baleting if you're interested.) – natevw Oct 20 '17 at 23:51