Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 4962 invoked from network); 31 Jul 2009 03:46:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jul 2009 03:46:39 -0000 Received: (qmail 27032 invoked by uid 500); 31 Jul 2009 03:46:39 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 26958 invoked by uid 500); 31 Jul 2009 03:46:38 -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 26944 invoked by uid 99); 31 Jul 2009 03:46:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 03:46:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 03:46:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C7F42234C046 for ; Thu, 30 Jul 2009 20:46:14 -0700 (PDT) Message-ID: <1046384700.1249011974811.JavaMail.jira@brutus> Date: Thu, 30 Jul 2009 20:46:14 -0700 (PDT) From: "Adam Kocoloski (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-442) Add a "view" or "format" function to process source doc on query In-Reply-To: <1177593234.1248886335038.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737411#action_12737411 ] Adam Kocoloski commented on COUCHDB-442: ---------------------------------------- Hmm Chris, I'm not sure I agree with that statement. I've seen production setups with ~5 GB view indexes where the view emitted (key,null) and used include_docs=true for the lookup. If the view had used sanitize(doc) it would've been much too big to be cached in main memory. Then you're pretty well screwed. > Add a "view" or "format" function to process source doc on query > ---------------------------------------------------------------- > > Key: COUCHDB-442 > URL: https://issues.apache.org/jira/browse/COUCHDB-442 > Project: CouchDB > Issue Type: Improvement > Components: JavaScript View Server > Reporter: Curt Arnold > > It is common practice to do emit(key, null) in a map function and then query with ?include_docs=true to retrieve the documents that were responsible for the entries. However, the full document may include information that is privileged or the full document may be substantially larger than the information needed to be transferred to the client. > The proposed enhancement is to allow defining a "view" function in addition to the existing "map" and "reduce" on a view. If specified, the view function would take the id, key, value and doc and return a JSON value that would be added as the "view" member to the row in the result set. > One of the use cases on http://wiki.apache.org/couchdb/Authentication_and_Authorization is to be able to specify that a user can retrieve the values from a view, but not add include_docs since that may expose information that they are not authorized to view. Without the "view" function, there would be pressure to start pushing things into the emitted value. > Production of views would be likely controlled using a include_views=true in the query string. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.