couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: builting changes filter functions
Date Sat, 13 Nov 2010 23:03:34 GMT
On Sat, Nov 13, 2010 at 8:39 PM, Paul Davis <paul.joseph.davis@gmail.com> wrote:
> On Sat, Nov 13, 2010 at 12:19 PM, Filipe David Manana
> <fdmanana@apache.org> wrote:
>> Without going into very deep analysis yet (no time this weekend):
>>
>> - I would prefer _doc_ids instead of _docids for the filter name =>
>> 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ît
>>
>> On Sat, Nov 13, 2010 at 3:47 PM, Benoit Chesneau <bchesneau@gmail.com> wrote:
>>> On Sat, Nov 13, 2010 at 4:38 PM, Benoit Chesneau <bchesneau@gmail.com>
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=continuous&timeout=500&since=7&filter=_docids
>>>> {"doc_ids":["something","anotherthing","andmore"]}
>>>>
>>>> or
>>>>
>>>> GET http://127.0.0.1:5984/test_suite_db/_changes?filter=_docids&doc_ids=[%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/dbf5b0181f10bf36927d4b44a2f3a98e07c60b44
>>>>
>>>>
>>>> OK for commit it ?
>>>>
>>>>
>>>> - benoît
>>>>
>>>
>>> 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.
>>  Unreasonable men adapt the world to themselves.
>>  That's why all progress depends on unreasonable men."
>>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message