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 E0161D7F1 for ; Wed, 1 Aug 2012 11:39:05 +0000 (UTC) Received: (qmail 51637 invoked by uid 500); 1 Aug 2012 11:39:05 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 51580 invoked by uid 500); 1 Aug 2012 11:39:05 -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 51000 invoked by uid 99); 1 Aug 2012 11:39:03 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 11:39:03 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 323F1142856 for ; Wed, 1 Aug 2012 11:39:03 +0000 (UTC) Date: Wed, 1 Aug 2012 11:39:03 +0000 (UTC) From: "Robert Newson (JIRA)" To: dev@couchdb.apache.org Message-ID: <1353860643.295.1343821143208.JavaMail.jiratomcat@issues-vm> In-Reply-To: <748516015.109.1343816942855.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (COUCHDB-1519) Allow validate_doc_update.js to be aware if the update went through an update function before 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-1519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426534#comment-13426534 ] Robert Newson commented on COUCHDB-1519: ---------------------------------------- So this request is better described as "Allow access to the request object in validate_doc_update requests?" I can't think of an objection that idea. The value of oldDoc, secObj and userCtx are all dependent on the local database so the obvious argument at the result of a validate_doc_update would vary when replicated is already anticipated and irrelevant. Can anyone see a reason not to pass the request object to validate_doc_update? > Allow validate_doc_update.js to be aware if the update went through an update function before > --------------------------------------------------------------------------------------------- > > Key: COUCHDB-1519 > URL: https://issues.apache.org/jira/browse/COUCHDB-1519 > Project: CouchDB > Issue Type: New Feature > Components: Database Core > Affects Versions: 1.2 > Reporter: Damjan Georgievski > > It would be useful for the validate_doc_update function to "know" if the document has been processed by an update function or is sent directly to the DB. > There are several possible ways to do it: > * allow the update function to update either the userCtx or the secObj objects, and let that change propagate to the validate_doc_update function > * add a completely new object that will be passed to both functions. update functions could then modify it. > * add some flag to validate_doc_update parameters to signal that the document is direct to DB or not. But this would limit the usefulness of the feature. > Adding special attributes to the document object, in an update function, that the validate function can check later, is not sufficient since that attribute can be sent directly to the DB also, and will be stored in the database. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira