You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Yves S. Garret" <yo...@gmail.com> on 2013/08/03 18:33:00 UTC
What happens when I delete?
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?
Re: What happens when I delete?
Posted by "Yves S. Garret" <yo...@gmail.com>.
On Sat, Aug 3, 2013 at 12:37 PM, Robert Newson <rn...@apache.org> wrote:
> 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 <yo...@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?
>
I see. Thanks for your help.
Re: What happens when I delete?
Posted by Robert Newson <rn...@apache.org>.
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 <yo...@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?