From dev-return-13206-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Sat Nov 13 23:03:34 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 77238 invoked from network); 13 Nov 2010 23:03:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Nov 2010 23:03:33 -0000 Received: (qmail 51845 invoked by uid 500); 13 Nov 2010 23:04:02 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 51811 invoked by uid 500); 13 Nov 2010 23:04:02 -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 51803 invoked by uid 99); 13 Nov 2010 23:04:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Nov 2010 23:04:02 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Nov 2010 23:03:55 +0000 Received: by fxm15 with SMTP id 15so1898557fxm.11 for ; Sat, 13 Nov 2010 15:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=NF0FdOR6cr64onO+M+0SrZJi9qprsOOVa3LH0796TNw=; b=qCQjIo3WlKjc0rPSwuWEXPpVoexOXmjZhUbKFpEnZGWb+0mwsQ3uV55arekNGOPZHw bQZEBkp3j37sVC8dwwmEe+WeUnCN3F0UfFtfLSpuElQNSjGo9QY4tEiZDwI6a9LijCMA fvGR3DCduvcRidjXubX+7Sa/6QlaG/P1b34wk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=E0/8/1EBJ6VnsRtU6GBkTa891an8UjYIyMxuawY4j5lSBfc1PlhOrNUMdYJ3+CTgJK Gg4EXClP1SBvoDy09VTRAKkuN5mxsXU5J3+Gccqo+grZQPsPgudr8NXzouV1M0kWe4Xk k7ZsprA1otDVcActXaX891S4qcD07IdWqjL/I= MIME-Version: 1.0 Received: by 10.223.81.78 with SMTP id w14mr3101454fak.5.1289689415041; Sat, 13 Nov 2010 15:03:35 -0800 (PST) Sender: fdmanana@gmail.com Received: by 10.223.96.143 with HTTP; Sat, 13 Nov 2010 15:03:34 -0800 (PST) In-Reply-To: References: Date: Sat, 13 Nov 2010 23:03:34 +0000 X-Google-Sender-Auth: e3UrrPt64bxMPJ468Q9Y99Yx6Nc Message-ID: Subject: Re: builting changes filter functions From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Nov 13, 2010 at 8:39 PM, Paul Davis w= rote: > On Sat, Nov 13, 2010 at 12:19 PM, Filipe David Manana > wrote: >> Without going into very deep analysis yet (no time this weekend): >> >> - I would prefer _doc_ids instead of _docids for the filter name =3D> >> besides being more readable, it will match the query parameter (named >> doc_ids) and the equivalent replicator option >> >> - In code variables, DocIds is also more readable than Docids - but >> this is just my very personal taste, and I understand Pythoners are >> used to alllowercasegluedwordscompletelyunreadable :) >> > > Actually, Pythonically it'd be > all_lowercase_glued_words_completely_unreadable for a variable name. > Though, if it were a class name it'd be > AllLowercaseGluedWordsCompletelyUnreadable. Hum, it's a bit inconsistent in some cases, like String.expandtabs or Dict.setdefault. Even for standard libraries/classes, doesn't seem to always follow the same naming convention. I'm not a huge Python fan :P > > FWIW. > > Paul > >> good work Beno=C3=AEt >> >> On Sat, Nov 13, 2010 at 3:47 PM, Benoit Chesneau w= rote: >>> On Sat, Nov 13, 2010 at 4:38 PM, Benoit Chesneau = wrote: >>>> Hi all, >>>> >>>> So since our last discussion i've rewrite builtin filter fonction to >>>> get changes according some docids. It now works on GET and POST by >>>> passing _docids as flter name. Then you could pass json encoded list >>>> of docid as a doc_ids query argument or a doc_id member of a json >>>> object in the body: >>>> >>>> POST /test_suite_db/_changes?feed=3Dcontinuous&timeout=3D500&since=3D7= &filter=3D_docids >>>> {"doc_ids":["something","anotherthing","andmore"]} >>>> >>>> or >>>> >>>> GET http://127.0.0.1:5984/test_suite_db/_changes?filter=3D_docids&doc_= ids=3D[%22something%22,%22anotherthing%22,%22andmore%22] >>>> >>>> I've also added another builtin to get changes if a design document is >>>> created or changed named "_design" . And maybe we could also add a >>>> "_regexp" builtin filter ? >>>> >>>> Diff is here : >>>> >>>> https://github.com/benoitc/couchdb/commit/dbf5b0181f10bf36927d4b44a2f3= a98e07c60b44 >>>> >>>> >>>> OK for commit it ? >>>> >>>> >>>> - beno=C3=AEt >>>> >>> >>> updated ptch to reuse code: >>> https://github.com/benoitc/couchdb/compare/master...native_filter >>> >> >> >> >> -- >> Filipe David Manana, >> fdmanana@gmail.com, fdmanana@apache.org >> >> "Reasonable men adapt themselves to the world. >> =C2=A0Unreasonable men adapt the world to themselves. >> =C2=A0That's why all progress depends on unreasonable men." >> > --=20 Filipe David Manana, fdmanana@gmail.com, fdmanana@apache.org "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."