[
https://issues.apache.org/jira/browse/COUCHDB-2568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Will Holley updated COUCHDB-2568:
---------------------------------
Description:
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}
was: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.
> 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)