You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Will Holley (JIRA)" <ji...@apache.org> on 2015/09/09 10:32:46 UTC

[jira] [Resolved] (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:all-tabpanel ]

Will Holley resolved COUCHDB-2568.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

> 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
>             Fix For: 2.0.0
>
>
> 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)