couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: What happens when I delete?
Date Sat, 03 Aug 2013 16:37:18 GMT
In, https://wiki.apache.org/couchdb/HTTP_Document_API see the
"Accessing Previous Revisions" section. Though note that previous
revisions are not replicated and are deleted for real on compaction.

B.

On 3 August 2013 17:33, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
> I'm looking at how I deleted a document from CouchDB:
>
> % curl -i -X DELETE "
> http://localhost:5984/music/4cb9c4d6b62ca04e7a6aa62687001852" -H "If-Match:
> 1-a731a68484dba7b65b38f80084d9bab4"
> HTTP/1.1 200 OK
> Server: CouchDB/1.3.1 (Erlang OTP/R16B01)
> ETag: "2-798e64a09c53d0362686477245fe539c"
> Date: Sat, 03 Aug 2013 16:03:50 GMT
> Content-Type: text/plain; charset=utf-8
> Content-Length: 95
> Cache-Control: must-revalidate
>
> {"ok":true,"id":"4cb9c4d6b62ca04e7a6aa62687001852","rev":"2-798e64a09c53d0362686477245fe539c"}
>
> Based on what I've read, documents do not get deleted per se.  A new
> "blank" document overwrites
> the previous one.
>
> However, when I tried retrieve a previous instance of the document, this is
> the issue that I
> encountered:
>
> % curl -i -X GET "
> http://localhost:5984/music/4cb9c4d6b62ca04e7a6aa62687001852" -H "If-Match:
> 1-a731a68484dba7b65b38f80084d9bab4"
> HTTP/1.1 404 Object Not Found
> Server: CouchDB/1.3.1 (Erlang OTP/R16B01)
> Date: Sat, 03 Aug 2013 16:05:01 GMT
> Content-Type: text/plain; charset=utf-8
> Content-Length: 41
> Cache-Control: must-revalidate
>
> {"error":"not_found","reason":"deleted"}
> % curl -i -X GET "
> http://localhost:5984/music/4cb9c4d6b62ca04e7a6aa62687001852" -H "If-Match:
> 2-798e64a09c53d0362686477245fe539c"
> HTTP/1.1 404 Object Not Found
> Server: CouchDB/1.3.1 (Erlang OTP/R16B01)
> Date: Sat, 03 Aug 2013 16:05:46 GMT
> Content-Type: text/plain; charset=utf-8
> Content-Length: 41
> Cache-Control: must-revalidate
>
> {"error":"not_found","reason":"deleted"}
>
> So, if a document is deleted, there is no way to access the previous
> version of the document?
>  Also, what happens to the previous revisions of a document?  Do they get
> deleted after some
> time?

Mime
View raw message