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

ASF subversion and git services commented on COUCHDB-3264:
----------------------------------------------------------

Commit 8dcc3fb175807ac18a3d7c1fc95364910ee8969e in couchdb-fabric's branch 
refs/heads/master from [~wilhol]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=8dcc3fb ]

Include conflicts parameter in doc_options

When a keys array is passed to _all_docs, fabric translates this
to individual open_doc calls. The conflicts=true query parameter is
specified as a view-level option and is not, by default, parsed as
an option that should be passed to open_doc.

As a workaround, explicitly copy the view-level conflict parameter into
the document options before open_doc is called.

An alternative approach would be to address this when the query
parameters are parsed, setting conflicts=true in both #mrargs and
detail of fabric, I elected to make the change here instead.

Fixes #COUCHDB-3264


> POST to _all_docs does not respect conflicts=true
> -------------------------------------------------
>
>                 Key: COUCHDB-3264
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3264
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 2.0.1
>            Reporter: Will Holley
>
> In CouchDB 2.0, POST to _all_docs with ids specified in the keys field does 
> not respect the conflicts=true parameter.
> In CouchDB 1.6.1:
> {code}
> $ curl -X PUT http://127.0.0.1:5984/test
> {"ok":true}
> $ curl -X POST http://127.0.0.1:5984/test/_bulk_docs -H 
> 'Content-type:application/json' -d '{ "docs":[{"_id":"foo","_rev": 
> "1-a1"},{"_id":"foo","_rev": "1-a2"}], "new_edits":false}'
> []
> $ curl -X GET 
> 'http://127.0.0.1:5984/test/_all_docs?include_docs=true&conflicts=true'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-a2"},"doc":{"_id":"foo","_rev":"1-a2","_conflicts":["1-a1"]}}
> ]}
> $ curl -X POST 
> 'http://127.0.0.1:5984/test/_all_docs?include_docs=true&conflicts=true' -H 
> 'Content-type:application/json' -d '{"keys":["foo"]}'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-a2"},"doc":{"_id":"foo","_rev":"1-a2","_conflicts":["1-a1"]}}
> ]}
> {code}
> In CouchDB 2.0:
> {code}
> $ curl -X PUT http://127.0.0.1:15984/test
> {"ok":true}
> $ curl -X POST http://127.0.0.1:15984/test/_bulk_docs -H 
> 'Content-type:application/json' -d '{ "docs":[{"_id":"foo","_rev": 
> "1-a1"},{"_id":"foo","_rev": "1-a2"}], "new_edits":false}'
> []
> $ curl -X GET 
> 'http://127.0.0.1:15984/test/_all_docs?include_docs=true&conflicts=true'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-a2"},"doc":{"_id":"foo","_rev":"1-a2","_conflicts":["1-a1"]}}
> ]}
> $ curl -X POST 
> 'http://127.0.0.1:15984/test/_all_docs?include_docs=true&conflicts=true' -H 
> 'Content-type:application/json' -d '{"keys":["foo"]}'
> {"total_rows":1,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-a2"},"doc":{"_id":"foo","_rev":"1-a2"}}
> ]}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to