couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klaus Trainer (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-642) Support rev in PUT URL
Date Sat, 08 Oct 2011 18:25:29 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123546#comment-13123546
] 

Klaus Trainer commented on COUCHDB-642:
---------------------------------------

Ah, nice to see that this work has been done. Thanks Randall! I like it that I now don't have
to always pass the whole document body when I just want to create or update an attachment.

> [...] the way I've written it already asserts that if it's present in more than one place
it [the document's revision number] has to match everywhere or it's a bad request.

Yeah. Having it rethought after a while, I now have a clear opinion: It should behave exactly
like in current trunk. That is, you should be able to pass the revision number where you would
like to (as query parameter, in the 'If-Match'-Header, or in the document body), and there
should be no precedence between different revision numbers (i.e., overriding).

+1 for closing that issue.
                
> Support rev in PUT URL
> ----------------------
>
>                 Key: COUCHDB-642
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-642
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: HTTP Interface
>         Environment: trunk 08 Feb 2010
>            Reporter: Brian Candler
>            Assignee: Randall Leeds
>            Priority: Minor
>         Attachments: 0001-Allow-for-the-current-revision-number-to-be.patch
>
>
> A DELETE request lets you append ?rev=xxxx to the URL. But this doesn't work with a PUT
request; you have to put the _rev in the body instead (even though the _id is taken from the
URL path)
> $ curl -X PUT -d "{}" http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo
> {"ok":true,"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"}
> $ curl -X PUT -d "{}" http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo?rev=1-967a00dff5e02add41819138abb3284d
> {"error":"conflict","reason":"Document update conflict."}
> $ curl -X PUT -d '{"_rev":"1-967a00dff5e02add41819138abb3284d"}' http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo
> {"ok":true,"id":"foo","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}
> Allowing ?rev in the URL would make PUT and DELETE more consistent, and would allow you
to replace an existing JSON doc with another one without having to merge the _rev into it
first.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message