I know I can retrieve all revisions of an "available" document, but can I retrieve the last "available" version of a deleted document? I do not know the revision id prior to the delete. This is the command I am currently running...it returns {"error":"not_found","reason":"deleted"}
.
curl -X GET http://localhost:5984/test_database/a213ccad?revs_info=true
Right-click the file or folder, and then select Restore previous versions. You'll see a list of available previous versions of the file or folder. The list will include files saved on a backup (if you're using Windows Backup to back up your files) as well as restore points, if both types are available.
Yes, files can be recovered after being deleted. The level of difficulty depends on how long ago the file was deleted, however, and you may need to use specialized tools if trying to recover data that has been corrupted.
To Restore That Important Missing File or Folder: Type Restore files in the search box on the taskbar, and then select Restore your files with File History. Look for the file you need, then use the arrows to see all its versions. When you find the version you want, select Restore to save it in its original location.
Here are the steps to restore a file or folder that was deleted or renamed (if the System Restore is enabled in advance): Double click on This PC icon on the desktop or press Windows + E to open File Explorer. Find the folder that contains the lost file or folder. Right click on it and select Restore previous versions.
I've got this problem, trying to recover deleted document, here is my solution:
0) until you run a compaction, get deleted history, e.g.:
curl http://example.iriscouch.com/test/_changes
1) you'll see deleted documents with $id and $rev, put empty document as new version, e.g.:
curl -X PUT http://example.iriscouch.com/test/$id?rev=$rev -H "Content-Type: application/json" -d {}
2) now you can get all revisions info, e.g:
curl http://example.iriscouch.com/test/$id?revs_info=true
See also Retrieve just deleted document
Besides _changes
, another good way to do this is to use keys
with _all_docs
:
GET $MYDB/_all_docs?keys=["foo"]
->
{
"offset": 0,
"rows": [
{
"id": "foo",
"key": "foo",
"value": {
"deleted": true,
"rev": "2-eec205a9d413992850a6e32678485900"
}
}
],
"total_rows": 0
}
Note that it has to be keys
; key
will not work, because only keys
returns info for deleted docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With