You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/17 23:30:20 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=15381574#comment-15381574 ] 

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

GitHub user banjiewen opened a pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/52

    Support additional doc option opts in views

    COUCHDB-2568 allowed several attachment-related doc open options to be
    passed through _all_docs queries. This patch extends that work to
    various other options by adding support for various doc open options to
    the view argument parser:
    
    - revs_info
    - deleted_conflicts
    - meta
    - r
    
    Additionally, this patch changes the behavior of the "conflicts" view
    option to furthermore apply the "conflicts" doc open option if
    include_docs=true is specified by the user.
    
    Without this functionality there is no way for a user to implement an
    "always on" conflict detection and resolution policy if they're using
    _all_docs POST queries as their primary document access path.
    
    COUCHDB-3064

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

    $ git pull https://github.com/banjiewen/couchdb-couch-mrview parse-more-doc-opts-in-views

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

    https://github.com/apache/couchdb-couch-mrview/pull/52.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 #52
    
----
commit f7777aa05d7c37abc70c1d2fc1442a79552e91d3
Author: Benjamin Anderson <b...@banjiewen.net>
Date:   2016-07-17T23:21:56Z

    Support additional doc option opts in views
    
    COUCHDB-2568 allowed several attachment-related doc open options to be
    passed through _all_docs queries. This patch extends that work to
    various other options by adding support for various doc open options to
    the view argument parser:
    
    - revs_info
    - deleted_conflicts
    - meta
    - r
    
    Additionally, this patch changes the behavior of the "conflicts" view
    option to furthermore apply the "conflicts" doc open option if
    include_docs=true is specified by the user.
    
    Without this functionality there is no way for a user to implement an
    "always on" conflict detection and resolution policy if they're using
    _all_docs POST queries as their primary document access path.
    
    COUCHDB-3064

----


> 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
>          Components: Database Core
>    Affects Versions: 2.0.0
>            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)