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 6D5F08711 for ; Mon, 8 Aug 2011 12:18:24 +0000 (UTC) Received: (qmail 34168 invoked by uid 500); 8 Aug 2011 12:18:22 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 33829 invoked by uid 500); 8 Aug 2011 12:18:17 -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 33820 invoked by uid 99); 8 Aug 2011 12:18:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 12:18:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sean.copenhaver@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 12:18:07 +0000 Received: by vws16 with SMTP id 16so4018856vws.11 for ; Mon, 08 Aug 2011 05:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Es3zB47WNsUN5iTSzQYi6Eri79mnmVxueiO3JT6awpY=; b=m7A0YrLuxXZnwF2jQGqPIIlgae4HgqrEyMFqPE9a4MkZ38YI5qkRi6kQrYE3SXHclB BwoVgG93VLVqdYgCoBYf4bDsxnK96pLSzjwYeHflrx9qpGiYcGXX5G7u6Z8kLgETHRVj 6drsqR73vyz04ATZ0pNwsxrdLWzZgrANj7aeY= MIME-Version: 1.0 Received: by 10.52.74.130 with SMTP id t2mr162549vdv.55.1312805865911; Mon, 08 Aug 2011 05:17:45 -0700 (PDT) Received: by 10.52.113.72 with HTTP; Mon, 8 Aug 2011 05:17:45 -0700 (PDT) In-Reply-To: <13241CB1-0BD1-4FBA-B09B-1536CD000822@gmail.com> References: <13241CB1-0BD1-4FBA-B09B-1536CD000822@gmail.com> Date: Mon, 8 Aug 2011 08:17:45 -0400 Message-ID: Subject: Re: How to use the changes feed with a view as filter From: Sean Copenhaver To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec501668f4bf38604a9fd6f50 --bcaec501668f4bf38604a9fd6f50 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Oh wow, I was unaware that you could filter by view. The code indeed makes it look that way. I'm not sure which release this was done in though, or if you would need to build from latest source. Anyway, the code makes me think the request would be more like this: GET http://myaccount.iriscouch.com/mydb/_change?filter=3D_view&view=3D_design/m= ydb/_view/my_view I get that from here: https://github.com/apache/couchdb/blob/trunk/src/couchdb/couch_changes.erl#= L144 Looks like those function clauses are to define the different built in filters plus the last one to catch custom ones. The one on that line looks like what you are after and it's expecting a 'view' query string parameter = I think. I believe the _design filter is to monitor for when a design document changes and not to filter by a function inside of it. I don't have anything setup to test this though. Hopefully someone with not knowledge is able to confirm this and which release this was in. On Mon, Aug 8, 2011 at 7:32 AM, Jeroen van Dijk wrote: > I've tried to run the changes feed on a specific view, but so far I haven= 't > succeeded. I'm only able to use the 'doc_ids' filter, but I can't filter > using a view. > > I've tried the following requests (using IrisCouch, couchdb version 1.1): > > GET > http://myaccount.iriscouch.com/mydb/_changes?filter=3D_doc_ids&doc_ids=3D= [ > "_design/mydb/_view/my_view] > GET > http://myaccount.iriscouch.com/mydb/_changes?filter=3D_design&design=3D_d= esign/mydb/_view/my_view > > Both give me the same result whereas I would expect the 'filter=3D_design= ' > to give me the result of the map function and not the changes of the des= ign > document itself. The second request also works without the design paramet= er: > > GET http://myaccount.iriscouch.com/mydb/_changes?filter=3D_design > > I think that also indicates I am doing something wrong. Anyone knows how = to > get this working? > > Thanks, > > Jeroen > > > NB. My Erlang is not good enough to understand what exactly happens here: > https://svn.apache.org/repos/asf/couchdb/tags/1.1.0/src/couchdb/couch_cha= nges.erl --=20 =93The limits of language are the limits of one's world. =93 -Ludwig von Wittgenstein --bcaec501668f4bf38604a9fd6f50--