Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E86FFCB88 for ; Mon, 3 Jun 2013 07:22:14 +0000 (UTC) Received: (qmail 1724 invoked by uid 500); 3 Jun 2013 07:22:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 1598 invoked by uid 500); 3 Jun 2013 07:22:11 -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 1301 invoked by uid 99); 3 Jun 2013 07:22:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 07:22:10 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.50.230.240] (HELO pluton.utt.fr) (193.50.230.240) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 07:22:03 +0000 Received: from smtp1.utt.fr (smtp1.utt.fr [193.50.230.122]) by pluton.utt.fr (8.13.1/8.13.1) with ESMTP id r537Lfoj027379 for ; Mon, 3 Jun 2013 09:21:41 +0200 Received: from smtp1.utt.fr (smtp1.utt.fr [127.0.0.1]) by localhost (Postfix) with SMTP id 091C7A681F3 for ; Mon, 3 Jun 2013 09:21:41 +0200 (CEST) Received: from wifi-personnels086.utt.fr (wifi-personnels086.utt.fr [10.19.1.86]) by smtp1.utt.fr (Postfix) with ESMTP id 03CB3A68130 for ; Mon, 3 Jun 2013 09:21:41 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: commonjs in validation docs From: =?iso-8859-1?Q?Aur=E9lien_B=E9nel?= In-Reply-To: Date: Mon, 3 Jun 2013 09:21:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <6941CDA6-21FB-4A37-A275-605BFFDE4C89@utt.fr> References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1503) X-Virus-Checked: Checked by ClamAV on apache.org Hi Stephen, > So I can't seem to get a validate_update_doc nested in a view field to = work. =20 Why would you do that? Validations and views are completely different = concepts. > "views": { > "validate_doc_update": "function(newdoc, olddoc, ctx, sec) = {throw {forbidden: 'You shall not pass.'}}" // this one doesn't work If you write this, `validate_doc_update` will be just a view. I'm pretty = sure this is not what you want. As a view, it should have a map and could have a reduce function, but = would have nothing to do with validation. =20 Regards, Aur=E9lien