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 0CA38D228 for ; Tue, 18 Sep 2012 16:10:41 +0000 (UTC) Received: (qmail 42979 invoked by uid 500); 18 Sep 2012 16:10:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 42880 invoked by uid 500); 18 Sep 2012 16:10:39 -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 42864 invoked by uid 99); 18 Sep 2012 16:10:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 16:10:39 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FSL_RCVD_USER,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; Tue, 18 Sep 2012 16:10:30 +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 q8IGA5X8015401 for ; Tue, 18 Sep 2012 18:10:05 +0200 Received: from smtp1.utt.fr (smtp1.utt.fr [127.0.0.1]) by localhost (Postfix) with SMTP id 43E7FA6826B for ; Tue, 18 Sep 2012 18:10:05 +0200 (CEST) Received: from wifi-eduroam1186.utt.fr (wifi-eduroam1186.utt.fr [10.25.2.186]) by smtp1.utt.fr (Postfix) with ESMTP id 3D4E8A6826A for ; Tue, 18 Sep 2012 18:10:05 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Exclude documents from view based on list of regex expressions From: =?iso-8859-1?Q?Aur=E9lien_B=E9nel?= In-Reply-To: <91593B54-D63F-47A6-BB7F-0B176D705C78@me.com> Date: Tue, 18 Sep 2012 18:10:05 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <91593B54-D63F-47A6-BB7F-0B176D705C78@me.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1278) Hi Carl, > Whats the best approach for excluding documents from a view based on a = list of regex expressions. For example I want to exclude anything where = doc.issue.name contains a value that matches a list of regex = expressions. > e.g. exclusion list: [/foo/, /bar/] I am not sure what is the best approach to do that. For your example, you could have done: function(o) { switch (o.issue.name) { case "foo": case "bar": break; default: emit(o.issue.name, null)=20 } } The pros is that you can add other exclude values very easily. But it = only works with strings. If you need real regexes, I suppose you will = need to build one huge regex containing them all.=20 Regards, Aur=E9lien=