You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Andrew Melo <an...@gmail.com> on 2009/11/08 18:57:08 UTC

Update API

Forgive me everyone, but my google-fu is having trouble finding the
documentation for the updates API for the newer version of Couch. Can
someone point me in the right direction?

Thanks,
Melo
-- 

--
Andrew Melo
Andrew.Melo@gmail.com

Re: Update API

Posted by Paul Davis <pa...@gmail.com>.
On Sun, Nov 8, 2009 at 2:01 PM, Andrew Melo <an...@gmail.com> wrote:
> Oh, I'm sorry, I think I misspoke. I was looking for the API that will
> notify me when a new document is added to the database.

Oh, you want the _changes API. There are tests for that too.

>> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing

That sure is a very descriptive name. Perhaps something like "The
Updates API" might work better.

Paul Davis

Re: Update API

Posted by Christopher O'Connell <jw...@gmail.com>.
Actually, I discovered that limit is only in trunk when testing externalJ.

I ended up using a hacky hack to only read 500 lines at a time and then
rewrite update seq to since+500. That way I can "chunk" it myself.

~ Christopher

On Sun, Nov 8, 2009 at 1:17 PM, Matt Goodall <ma...@gmail.com> wrote:

> 2009/11/8 Christopher O'Connell <jw...@gmail.com>:
> > Just as a quick aside on the changes API, as a couple of people helped me
> > figure out last night in the IRC channel, do be careful about grabbing
> the
> > canges API if its very large, as some JSON processing libraries take
> obscene
> > amounts of space to decode a JSON object that large.
> >
> > I don't think it's on the wiki, but limit=n works for _changes
>
> True for trunk but, sadly, not for the 0.10.x series.  A workaround is
> to use the continuous feed - each change arrives on its own line as a
> JSON object so memory use can stay nice and low.
>
> I do wonder about the implementation of limit a little, the default
> seems a little arbitrary ;-).
>
>    Limit = list_to_integer(couch_httpd:qs_value(Req, "limit",
> "1000000000000000")),
>
> Surely the limit should either default to infinite or something that
> the client might sensibly handle, say 1000?
>
> Note: there's also a new descending=(true|false) _changes arg in trunk
> too ... although I can't think of a usecase for it.
>
> - Matt
>
> >
> > ~ Christopher
> >
> > On Sun, Nov 8, 2009 at 12:08 PM, Matt Goodall <matt.goodall@gmail.com
> >wrote:
> >
> >> 2009/11/8 Andrew Melo <an...@gmail.com>:
> >> > Oh, I'm sorry, I think I misspoke. I was looking for the API that will
> >> > notify me when a new document is added to the database.
> >>
> >> I think this is what you're looking for:
> >>
> >> http://wiki.apache.org/couchdb/HTTP_database_API#Changes
> >>
> >> - Matt
> >>
> >> >
> >> > thanks,
> >> > Andrew
> >> >
> >> > On Sun, Nov 8, 2009 at 12:59 PM, Dave Ray <da...@gmail.com> wrote:
> >> >> There's also a page on the Wiki here:
> >> >>
> >> >>
> >>
> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing
> >> >>
> >> >> but I would trust the test suite more :)
> >> >>
> >> >> Dave
> >> >>
> >> >> On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com>
> >> wrote:
> >> >>> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <
> >> paul.joseph.davis@gmail.com> wrote:
> >> >>>> Andrew,
> >> >>>>
> >> >>>> Don't forget the Futon test suite. There's an update_documents.js
> test
> >> >>>> that is probably the most authoritative source of info on that. To
> my
> >> >>>> knowledge no one has started a wiki page.
> >> >>>>
> >> >>>> Paul
> >> >>>
> >> >>> Paul,
> >> >>>
> >> >>> Thanks for the pointer. I'll try and grok those files.
> >> >>>
> >> >>> Best regards,
> >> >>> Andrew
> >> >>>
> >> >>>
> >> >>>>
> >> >>>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <
> andrew.melo@gmail.com>
> >> wrote:
> >> >>>>> Forgive me everyone, but my google-fu is having trouble finding
> the
> >> >>>>> documentation for the updates API for the newer version of Couch.
> Can
> >> >>>>> someone point me in the right direction?
> >> >>>>>
> >> >>>>> Thanks,
> >> >>>>> Melo
> >> >>>>> --
> >> >>>>>
> >> >>>>> --
> >> >>>>> Andrew Melo
> >> >>>>> Andrew.Melo@gmail.com
> >> >>>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>>
> >> >>> --
> >> >>> Andrew Melo
> >> >>> Andrew.Melo@gmail.com
> >> >>>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> >
> >> > --
> >> > Andrew Melo
> >> > Andrew.Melo@gmail.com
> >> >
> >>
> >
>

Re: Update API

Posted by Matt Goodall <ma...@gmail.com>.
2009/11/8 Christopher O'Connell <jw...@gmail.com>:
> Just as a quick aside on the changes API, as a couple of people helped me
> figure out last night in the IRC channel, do be careful about grabbing the
> canges API if its very large, as some JSON processing libraries take obscene
> amounts of space to decode a JSON object that large.
>
> I don't think it's on the wiki, but limit=n works for _changes

True for trunk but, sadly, not for the 0.10.x series.  A workaround is
to use the continuous feed - each change arrives on its own line as a
JSON object so memory use can stay nice and low.

I do wonder about the implementation of limit a little, the default
seems a little arbitrary ;-).

    Limit = list_to_integer(couch_httpd:qs_value(Req, "limit",
"1000000000000000")),

Surely the limit should either default to infinite or something that
the client might sensibly handle, say 1000?

Note: there's also a new descending=(true|false) _changes arg in trunk
too ... although I can't think of a usecase for it.

- Matt

>
> ~ Christopher
>
> On Sun, Nov 8, 2009 at 12:08 PM, Matt Goodall <ma...@gmail.com>wrote:
>
>> 2009/11/8 Andrew Melo <an...@gmail.com>:
>> > Oh, I'm sorry, I think I misspoke. I was looking for the API that will
>> > notify me when a new document is added to the database.
>>
>> I think this is what you're looking for:
>>
>> http://wiki.apache.org/couchdb/HTTP_database_API#Changes
>>
>> - Matt
>>
>> >
>> > thanks,
>> > Andrew
>> >
>> > On Sun, Nov 8, 2009 at 12:59 PM, Dave Ray <da...@gmail.com> wrote:
>> >> There's also a page on the Wiki here:
>> >>
>> >>
>> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing
>> >>
>> >> but I would trust the test suite more :)
>> >>
>> >> Dave
>> >>
>> >> On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com>
>> wrote:
>> >>> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <
>> paul.joseph.davis@gmail.com> wrote:
>> >>>> Andrew,
>> >>>>
>> >>>> Don't forget the Futon test suite. There's an update_documents.js test
>> >>>> that is probably the most authoritative source of info on that. To my
>> >>>> knowledge no one has started a wiki page.
>> >>>>
>> >>>> Paul
>> >>>
>> >>> Paul,
>> >>>
>> >>> Thanks for the pointer. I'll try and grok those files.
>> >>>
>> >>> Best regards,
>> >>> Andrew
>> >>>
>> >>>
>> >>>>
>> >>>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com>
>> wrote:
>> >>>>> Forgive me everyone, but my google-fu is having trouble finding the
>> >>>>> documentation for the updates API for the newer version of Couch. Can
>> >>>>> someone point me in the right direction?
>> >>>>>
>> >>>>> Thanks,
>> >>>>> Melo
>> >>>>> --
>> >>>>>
>> >>>>> --
>> >>>>> Andrew Melo
>> >>>>> Andrew.Melo@gmail.com
>> >>>>>
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> --
>> >>> Andrew Melo
>> >>> Andrew.Melo@gmail.com
>> >>>
>> >>
>> >
>> >
>> >
>> > --
>> >
>> > --
>> > Andrew Melo
>> > Andrew.Melo@gmail.com
>> >
>>
>

Re: Update API

Posted by Christopher O'Connell <jw...@gmail.com>.
Just as a quick aside on the changes API, as a couple of people helped me
figure out last night in the IRC channel, do be careful about grabbing the
canges API if its very large, as some JSON processing libraries take obscene
amounts of space to decode a JSON object that large.

I don't think it's on the wiki, but limit=n works for _changes

~ Christopher

On Sun, Nov 8, 2009 at 12:08 PM, Matt Goodall <ma...@gmail.com>wrote:

> 2009/11/8 Andrew Melo <an...@gmail.com>:
> > Oh, I'm sorry, I think I misspoke. I was looking for the API that will
> > notify me when a new document is added to the database.
>
> I think this is what you're looking for:
>
> http://wiki.apache.org/couchdb/HTTP_database_API#Changes
>
> - Matt
>
> >
> > thanks,
> > Andrew
> >
> > On Sun, Nov 8, 2009 at 12:59 PM, Dave Ray <da...@gmail.com> wrote:
> >> There's also a page on the Wiki here:
> >>
> >>
> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing
> >>
> >> but I would trust the test suite more :)
> >>
> >> Dave
> >>
> >> On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com>
> wrote:
> >>> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <
> paul.joseph.davis@gmail.com> wrote:
> >>>> Andrew,
> >>>>
> >>>> Don't forget the Futon test suite. There's an update_documents.js test
> >>>> that is probably the most authoritative source of info on that. To my
> >>>> knowledge no one has started a wiki page.
> >>>>
> >>>> Paul
> >>>
> >>> Paul,
> >>>
> >>> Thanks for the pointer. I'll try and grok those files.
> >>>
> >>> Best regards,
> >>> Andrew
> >>>
> >>>
> >>>>
> >>>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com>
> wrote:
> >>>>> Forgive me everyone, but my google-fu is having trouble finding the
> >>>>> documentation for the updates API for the newer version of Couch. Can
> >>>>> someone point me in the right direction?
> >>>>>
> >>>>> Thanks,
> >>>>> Melo
> >>>>> --
> >>>>>
> >>>>> --
> >>>>> Andrew Melo
> >>>>> Andrew.Melo@gmail.com
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>>
> >>> --
> >>> Andrew Melo
> >>> Andrew.Melo@gmail.com
> >>>
> >>
> >
> >
> >
> > --
> >
> > --
> > Andrew Melo
> > Andrew.Melo@gmail.com
> >
>

Re: Update API

Posted by Matt Goodall <ma...@gmail.com>.
2009/11/8 Andrew Melo <an...@gmail.com>:
> Oh, I'm sorry, I think I misspoke. I was looking for the API that will
> notify me when a new document is added to the database.

I think this is what you're looking for:

http://wiki.apache.org/couchdb/HTTP_database_API#Changes

- Matt

>
> thanks,
> Andrew
>
> On Sun, Nov 8, 2009 at 12:59 PM, Dave Ray <da...@gmail.com> wrote:
>> There's also a page on the Wiki here:
>>
>> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing
>>
>> but I would trust the test suite more :)
>>
>> Dave
>>
>> On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com> wrote:
>>> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <pa...@gmail.com> wrote:
>>>> Andrew,
>>>>
>>>> Don't forget the Futon test suite. There's an update_documents.js test
>>>> that is probably the most authoritative source of info on that. To my
>>>> knowledge no one has started a wiki page.
>>>>
>>>> Paul
>>>
>>> Paul,
>>>
>>> Thanks for the pointer. I'll try and grok those files.
>>>
>>> Best regards,
>>> Andrew
>>>
>>>
>>>>
>>>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com> wrote:
>>>>> Forgive me everyone, but my google-fu is having trouble finding the
>>>>> documentation for the updates API for the newer version of Couch. Can
>>>>> someone point me in the right direction?
>>>>>
>>>>> Thanks,
>>>>> Melo
>>>>> --
>>>>>
>>>>> --
>>>>> Andrew Melo
>>>>> Andrew.Melo@gmail.com
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> --
>>> Andrew Melo
>>> Andrew.Melo@gmail.com
>>>
>>
>
>
>
> --
>
> --
> Andrew Melo
> Andrew.Melo@gmail.com
>

Re: Update API

Posted by Andrew Melo <an...@gmail.com>.
Oh, I'm sorry, I think I misspoke. I was looking for the API that will
notify me when a new document is added to the database.

thanks,
Andrew

On Sun, Nov 8, 2009 at 12:59 PM, Dave Ray <da...@gmail.com> wrote:
> There's also a page on the Wiki here:
>
> http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing
>
> but I would trust the test suite more :)
>
> Dave
>
> On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com> wrote:
>> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <pa...@gmail.com> wrote:
>>> Andrew,
>>>
>>> Don't forget the Futon test suite. There's an update_documents.js test
>>> that is probably the most authoritative source of info on that. To my
>>> knowledge no one has started a wiki page.
>>>
>>> Paul
>>
>> Paul,
>>
>> Thanks for the pointer. I'll try and grok those files.
>>
>> Best regards,
>> Andrew
>>
>>
>>>
>>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com> wrote:
>>>> Forgive me everyone, but my google-fu is having trouble finding the
>>>> documentation for the updates API for the newer version of Couch. Can
>>>> someone point me in the right direction?
>>>>
>>>> Thanks,
>>>> Melo
>>>> --
>>>>
>>>> --
>>>> Andrew Melo
>>>> Andrew.Melo@gmail.com
>>>>
>>>
>>
>>
>>
>> --
>>
>> --
>> Andrew Melo
>> Andrew.Melo@gmail.com
>>
>



-- 

--
Andrew Melo
Andrew.Melo@gmail.com

Re: Update API

Posted by Dave Ray <da...@gmail.com>.
There's also a page on the Wiki here:

http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing

but I would trust the test suite more :)

Dave

On Sun, Nov 8, 2009 at 1:24 PM, Andrew Melo <an...@gmail.com> wrote:
> On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <pa...@gmail.com> wrote:
>> Andrew,
>>
>> Don't forget the Futon test suite. There's an update_documents.js test
>> that is probably the most authoritative source of info on that. To my
>> knowledge no one has started a wiki page.
>>
>> Paul
>
> Paul,
>
> Thanks for the pointer. I'll try and grok those files.
>
> Best regards,
> Andrew
>
>
>>
>> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com> wrote:
>>> Forgive me everyone, but my google-fu is having trouble finding the
>>> documentation for the updates API for the newer version of Couch. Can
>>> someone point me in the right direction?
>>>
>>> Thanks,
>>> Melo
>>> --
>>>
>>> --
>>> Andrew Melo
>>> Andrew.Melo@gmail.com
>>>
>>
>
>
>
> --
>
> --
> Andrew Melo
> Andrew.Melo@gmail.com
>

Re: Update API

Posted by Andrew Melo <an...@gmail.com>.
On Sun, Nov 8, 2009 at 12:18 PM, Paul Davis <pa...@gmail.com> wrote:
> Andrew,
>
> Don't forget the Futon test suite. There's an update_documents.js test
> that is probably the most authoritative source of info on that. To my
> knowledge no one has started a wiki page.
>
> Paul

Paul,

Thanks for the pointer. I'll try and grok those files.

Best regards,
Andrew


>
> On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com> wrote:
>> Forgive me everyone, but my google-fu is having trouble finding the
>> documentation for the updates API for the newer version of Couch. Can
>> someone point me in the right direction?
>>
>> Thanks,
>> Melo
>> --
>>
>> --
>> Andrew Melo
>> Andrew.Melo@gmail.com
>>
>



-- 

--
Andrew Melo
Andrew.Melo@gmail.com

Re: Update API

Posted by Paul Davis <pa...@gmail.com>.
Andrew,

Don't forget the Futon test suite. There's an update_documents.js test
that is probably the most authoritative source of info on that. To my
knowledge no one has started a wiki page.

Paul

On Sun, Nov 8, 2009 at 12:57 PM, Andrew Melo <an...@gmail.com> wrote:
> Forgive me everyone, but my google-fu is having trouble finding the
> documentation for the updates API for the newer version of Couch. Can
> someone point me in the right direction?
>
> Thanks,
> Melo
> --
>
> --
> Andrew Melo
> Andrew.Melo@gmail.com
>