Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E09A9199 for ; Fri, 19 Dec 2014 10:04:19 +0000 (UTC) Received: (qmail 24678 invoked by uid 500); 19 Dec 2014 10:04:15 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 24618 invoked by uid 500); 19 Dec 2014 10:04:15 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 24565 invoked by uid 99); 19 Dec 2014 10:04:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Dec 2014 10:04:15 +0000 Date: Fri, 19 Dec 2014 10:04:15 +0000 (UTC) From: "Alexander Shorin (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (COUCHDB-2522) CouchDB 2.0 /_changes feed does not return full attachment data with attachments=true MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-2522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander Shorin closed COUCHDB-2522. ------------------------------------- Resolution: Duplicate While you make it better and with examples, there is already another issue about. > CouchDB 2.0 /_changes feed does not return full attachment data with attachments=true > ------------------------------------------------------------------------------------- > > Key: COUCHDB-2522 > URL: https://issues.apache.org/jira/browse/COUCHDB-2522 > Project: CouchDB > Issue Type: Bug > Security Level: public(Regular issues) > Components: Database Core > Reporter: Glynn Bird > > In CouchDB 1.6, if a document is created with an attachment, and the _changes feed is consumed with '?include_docs=true&attachments=true', the full attachments are seen in the feed e.g.: > {Code} > $ curl -X DELETE http://127.0.0.1:5984/test > {"ok":true} > ~$ 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": "bob", "_attachments": { "foo.txt": {"content_type": "text/plain","data": "holy moly"} } }' > {"ok":true,"id":"6fb52c4798e6186baf9871ce19000a8d","rev":"1-8ccb83bd8362d56d396fb84e875dcae9"} > ~$ curl 'http://127.0.0.1:5984/test/_changes?include_docs=true&attachments=true'{"results":[ > {"seq":1,"id":"6fb52c4798e6186baf9871ce19000a8d","changes":[{"rev":"1-8ccb83bd8362d56d396fb84e875dcae9"}],"doc":{"_id":"6fb52c4798e6186baf9871ce19000a8d","_rev":"1-8ccb83bd8362d56d396fb84e875dcae9","id":"bob","_attachments":{"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-iRNdzYnZ/dk8u44XAJXaAQ==","data":"holymoly"}}}} > ], > "last_seq":1} > {Code} > In CouchDB 2.0, only the stub document is returned: > {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": "bob", "_attachments": { "foo.txt": {"content_type": "text/plain","data": "holy moly"} } }' > {"ok":true,"id":"fdd888086d37edf3a60c9bfb1c00297d","rev":"1-8ccb83bd8362d56d396fb84e875dcae9"} > ~$ curl 'http://127.0.0.1:15984/test/_changes?include_docs=true&attachments=true' > {"results":[ > {"seq":[1,"g1AAAAFxeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MymBMZc4EC7MkWiYamKSaYynEakaQAJJPsQaYkMuBW5QBSFQ-2C2gr2K6kZPPkVMM03HoSQHrqCZicxwIkGRqAFFDhfMIqF0BU7ies8gBE5X3CKh9AVILcmQUAbypgyA"],"id":"fdd888086d37edf3a60c9bfb1c00297d","changes":[{"rev":"1-8ccb83bd8362d56d396fb84e875dcae9"}],"doc":{"_id":"fdd888086d37edf3a60c9bfb1c00297d","_rev":"1-8ccb83bd8362d56d396fb84e875dcae9","id":"bob","_attachments":{"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-iRNdzYnZ/dk8u44XAJXaAQ==","length":6,"stub":true}}}} > ], > "last_seq":[1,"g1AAAAGzeJyFz00OgkAMBeD6k-jOI-gJDGWYMKzkJjrtQAhBPILeRG-iN9GbYBETYDEhTV6T13yLVgCwLhYONvXFZZhiGO8DGazkMLdA26ZpymJuZ2cpVmwsahd5Ae0k6fA38DNaZRSz8Zu0NceRIY45w9xvTq25jgyGmBAqr6mXknCTJezeu5AirRKacI_OPXun0CRm0r069x44x9bkesJ9Ojf4jwPUbLH8Ang9bN8"],"pending":0} > {Code} > This causes PouchDB's tests which passed with 1.6 to fail with 2.0 -- This message was sent by Atlassian JIRA (v6.3.4#6332)