Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 37375 invoked from network); 15 Nov 2010 20:02:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Nov 2010 20:02:44 -0000 Received: (qmail 34164 invoked by uid 500); 15 Nov 2010 20:03:10 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 34133 invoked by uid 500); 15 Nov 2010 20:03:10 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 34125 invoked by uid 99); 15 Nov 2010 20:03:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 20:03:10 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.244.253.218] (HELO mail.traeumt.net) (80.244.253.218) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 20:03:02 +0000 Received: from [192.168.178.25] (brln-d9ba670c.pool.mediaWays.net [217.186.103.12]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.traeumt.net (Postfix) with ESMTPSA id B49BD3C285 for ; Mon, 15 Nov 2010 21:02:41 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1082) Subject: Re: Supporting "?attachments=true" for views From: Jan Lehnardt In-Reply-To: Date: Mon, 15 Nov 2010 21:02:41 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1082) Hi Igor, On 15 Nov 2010, at 19:07, Igor Kolomiets wrote: > Someone already asked about this feature recently, but that remained = unanswered. >=20 > I'm looking for support of "attachments=3Dtrue" feature for view that > would include the content of document's attachments similar to a > single-document query operation. >=20 > My application is dealing with documents that store its binary data as > attachment. Currently my application must issue N+1 queries (one to > query view and then N queries to get documents' attachments). > With "attachments=3Dtrue" that will be just a single view query. >=20 > May be there are fundamental difficulties that prevent implementation > of this feature? If attachments are to be returned inside the view result JSON then the would have to be base64 encoded (on the CouchDB side) and decoded on the client. This is very inefficient and we're not likely to add that particular feature. Making multiple requests is way more efficient there. I hope that helps :) Cheers Jan --=20