[
https://issues.apache.org/jira/browse/COUCHDB-2568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14315969#comment-14315969
]
ASF subversion and git services commented on COUCHDB-2568:
----------------------------------------------------------
Commit 9664463d9b2b2dc11f1a28896eaee6b39ec5177f in couchdb-fabric's branch
refs/heads/master from [~wilhol]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=9664463 ]
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 closes #13
COUCHDB-2568
Signed-off-by: Alexander Shorin <[email protected]>
> 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)