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 CCB0ACBD9 for ; Mon, 3 Jun 2013 07:31:24 +0000 (UTC) Received: (qmail 12325 invoked by uid 500); 3 Jun 2013 07:31:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12297 invoked by uid 500); 3 Jun 2013 07:31:23 -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 12289 invoked by uid 99); 3 Jun 2013 07:31:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 07:31:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of snbartell@gmail.com designates 209.85.160.42 as permitted sender) Received: from [209.85.160.42] (HELO mail-pb0-f42.google.com) (209.85.160.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 07:31:18 +0000 Received: by mail-pb0-f42.google.com with SMTP id uo1so5269646pbc.29 for ; Mon, 03 Jun 2013 00:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=jRBCFdMR1VICMx2zqiFACzSzDB21CqQjonyDKR8HUKQ=; b=ji/ZAfX3qJgNFejjvVOwZeFhfC1Eh3STuWVj+r899chZEVFYK0Tuai8wck5Z69Nxki pvfdQ4cSuR5sAyWbO6M6+V6PZITlgIwjBliFOiviV++ykkRcVvqfuIqIH1JBKp4vJx/b 1z+yAc1THo5qgPEY1ce28M6/Dq3L8R3nl+RtW9zIIfS3f92e5WAnclYw8iXde8zSx5gp 06kNs6g4lkIeooENPCFCDC9Z2uLskYuIekkproFHCc3qn1j5EjlNYJ3BerjHfyu69cfz iJfEJnjyrwakMv9oZyISP1C/yQwcfUs54SSzEjgH1lHewnHK8/8+i2LACcP3Zg2Lye1r 7PHQ== X-Received: by 10.68.208.39 with SMTP id mb7mr23340427pbc.84.1370244657931; Mon, 03 Jun 2013 00:30:57 -0700 (PDT) Received: from [192.168.1.2] (cpe-172-251-93-208.socal.res.rr.com. [172.251.93.208]) by mx.google.com with ESMTPSA id ag4sm57921221pbc.20.2013.06.03.00.30.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 00:30:57 -0700 (PDT) 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: Stephen Bartell In-Reply-To: <6941CDA6-21FB-4A37-A275-605BFFDE4C89@utt.fr> Date: Mon, 3 Jun 2013 00:30:55 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <39C72F8B-581A-4562-AC2A-59E46717F47C@gmail.com> References: <6941CDA6-21FB-4A37-A275-605BFFDE4C89@utt.fr> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1503) X-Virus-Checked: Checked by ClamAV on apache.org I thought it was strange too, but thats from the docs = (http://couchdb.readthedocs.org/en/latest/query-servers.html#commonjs-modu= les). The way I interpret the example is "its ok to put validation docs = inside the views field so that you can have access to commonjs = exports.". This must just be a shitty example. On Jun 3, 2013, at 12:21 AM, Aur=E9lien B=E9nel = wrote: > Hi Stephen, >=20 >> So I can't seem to get a validate_update_doc nested in a view field = to work. =20 >=20 > Why would you do that? Validations and views are completely different = concepts. >=20 >> "views": { >> "validate_doc_update": "function(newdoc, olddoc, ctx, sec) = {throw {forbidden: 'You shall not pass.'}}" // this one doesn't work >=20 > 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 >=20 > Regards, >=20 > Aur=E9lien >=20