AlexanderKaraberov edited a comment on issue #592: MRView's seq btree needs 
custom sorter function.
URL: https://github.com/apache/couchdb/issues/592#issuecomment-409284332
 
 
   Hi @eiri  
   I know that this is perhaps not a proper place to ask this question but I 
don't want to escalate and create a separate issue for a behaviour which just 
seems confusing to me and probably is not a bug at all.
   So I have a document in the db which I delete either via `DELETE 
/db/doc?rev=1-aa...` or via `PUT db/doc?rev=1-aa...  -d "{_deleted":true}"`. 
   And now I want to "undelete" it via `PUT db/doc?rev=2-aa... -d 
"{_deleted":false}"`. This was working fine in the CouchDB 1.x and is something 
what I'd expect to work in 2.x too, because when updating an existing document, 
the current document revision must be included in the document. But now in 
CouchDB 2.x I receive:
   ```erlang
   {"error":"conflict","reason":"Document update conflict."}
   ```
   But this works fine if I'm not including document revision in the request 
for the case when I "undelete" the doc like this: `PUT db/doc -d 
"{_deleted":false}"`. So, the actual logic still works and I see all the 
corresponding revisions via `revs_info=true`. My question is this an expected 
behaviour? And if yes what were the reasons behind this? I think this has 
something to do with this logic inside of 
[update_docs/4](https://github.com/apache/couchdb/blob/master/src/couch/src/couch_db.erl#L1050)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to