You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/02/06 19:15:35 UTC

[jira] [Commented] (COUCHDB-2568) CouchDB 2.0 /_all_docs does not return full attachment data with keys=["somekey"]&attachments=true

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

ASF GitHub Bot commented on COUCHDB-2568:
-----------------------------------------

GitHub user willholley opened a pull request:

    https://github.com/apache/couchdb-fabric/pull/13

    Respect doc_options during _all_docs serialization

    When full documents are returned as part of an _all_docs response, respect doc_options (e.g. attachments=true) during JSON serialization. This only affects the code path taken when specific keys are requested - the standard _all_docs handling seems to deal with these options as expected.
    
    Fixes COUCHDB-2568

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/willholley/couchdb-fabric 2568-support-attachments-true-all-docs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fabric/pull/13.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13
    
----
commit 4a0f1e6e17b665c21a23f4b392c50aae7abb8e0b
Author: Will Holley <wi...@gmail.com>
Date:   2015-02-06T17:52:31Z

    Respect doc_options during _all_docs serialization
    
    When full documents are returned as part of an _all_docs response,
    respect doc_options (e.g. attachments=true) during JSON serialization.
    
    Fixes COUCHDB-2568

----


> CouchDB 2.0 /_all_docs does not return full attachment data with keys=["somekey"]&attachments=true
> --------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-2568
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2568
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core
>            Reporter: Will Holley
>
> Similar to case COUCHDB-2522, in CouchDB 1.6, '/_all_docs'?keys=["somekey"]&include_docs=true&attachments=true' returns the full attachment data. In the clustered CouchDB 2.0 interface, the attachments query parameter is ignored.
> In CouchDB 1.6:
> {code}
> ~$ curl -X PUT http://127.0.0.1:5984/test
> {"ok":true}
> ~$ curl -X POST http://127.0.0.1:5984/test -H 'Content-type:application/json' -d '{ "_id": "foo", "_attachments": { "bar.txt": {"content_type": "text/plain","data": "holy moly"} } }'
> {"ok":true,"id":"foo","rev":"1-b4adf85456c3026765ddee2d36c3814f"}
> ~$ curl -g 'http://127.0.0.1:5984/test/_all_docs?keys=["foo"]&include_docs=true&attachments=true'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-b4adf85456c3026765ddee2d36c3814f"},"doc":{"_id":"foo","_rev":"1-b4adf85456c3026765ddee2d36c3814f","_attachments":{"bar.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-iRNdzYnZ/dk8u44XAJXaAQ==","data":"holymoly"}}}}
> ]}
> {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 -H 'Content-type:application/json' -d '{ "_id": "foo", "_attachments": { "bar.txt": {"content_type": "text/plain","data": "holy moly"} } }'
> {"ok":true,"id":"foo","rev":"1-b4adf85456c3026765ddee2d36c3814f"}
> ~$ curl -g 'http://127.0.0.1:15984/test/_all_docs?keys=["foo"]&include_docs=true&attachments=true'
> {"total_rows":1,"rows":[
> {"id":"foo","key":"foo","value":{"rev":"1-b4adf85456c3026765ddee2d36c3814f"},"doc":{"_id":"foo","_rev":"1-b4adf85456c3026765ddee2d36c3814f","_attachments":{"bar.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-iRNdzYnZ/dk8u44XAJXaAQ==","length":6,"stub":true}}}}
> ]}
> {code}



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