couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: DELETE vs. _deleted:true
Date Mon, 01 Jul 2013 18:31:21 GMT
1. Correct.
2. Correct.

With setting `_deleted: true` it's possible to keep existed or set
some additional information about deletion. For instance:

> curl -XPUT http://localhost:5984/db/docid\?rev\=2-541a08c89aef73030c0af847ce79d65d  
-d '{"_deleted": true, "reason": "deprecated"}' -H "Content-Type:application/json"
{"ok":true,"id":"docid","rev":"3-2b7c72ba9c17487f4b646efcaf740e2b"}
> curl http://localhost:5984/db/docid\?rev\=3-2b7c72ba9c17487f4b646efcaf740e2b
{"_id": "docid", "_rev": "3-2b7c72ba9c17487f4b646efcaf740e2b",
"_deleted": true, "reason": "deprecated"}

--
,,,^..^,,,


On Mon, Jul 1, 2013 at 10:21 PM, Stephen Bartell <snbartell@gmail.com> wrote:
> Quick question on deleting.
>
> Are the following assumptions correct:
>
> 1. If i use the DELETE verb, a delete handler is invoked in which the following operations
will render the doc deleted:
>         a) All data except `_id`, and `_rev` is stripped from the doc
>         b) a field `_deleted` is set to true.
>
> 2. If I take a doc and create the `_deleted` field and set it to true myself, then the
doc is deleted; even though all data except _id and _rev are still present.
>
> Thanks,

Mime
View raw message