On Tue, Dec 29, 2009 at 5:33 PM, Joscha Feth <[email protected]> wrote:
> Joscha Feth wrote:
>
>> I am doing exactly the same in my application and the gap between #1
>> and #2 also worried me - a special header sounds like a feasible
>> solution and I can't see any downside besides the few bytes of
>> overhead in the header for each request.
>
>
> Just for the record: you can create a custom list/show function, which
> adds the header:
>
> "lists": {
> mylist : "function(head, req) { start({\"code\": 200, \"headers\":
> {\"X-Update-Seq\": (\"\"+req.info.update_seq)}}); send(\"whatever\"); }"
> }
>
> One comment: you need to convert the update_seq into a string before
> sending it back via start() - might be a bug.
>
I think a fine way to add this information would be in the JSON view
response body itself, something like:
{"total_rows":1000,"offset":0, "update_seq": 1001, "rows":[
{"id":"1","key":1,"value":null},
...
This patch should be among the more trivial for a new Erlang / CouchDB
author to implement.
I see no reason not to add this feature. If anyone wants to implement,
and has questions or needs help getting started, the dev@ mailing list
is the place.
Cheers,
Chris
> regards,
> Joscha
>
> --
>
>
>
--
Chris Anderson
http://jchrisa.net
http://couch.io