You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Jan Snasel <ja...@bluepartners.cz> on 2010/02/17 16:49:27 UTC

revision in view

Hello,

You created greate piece of software, indeed. I'm missing only a small feature - add "_rev" field for each document in view result. Imagine situation when client (javascript application in browser window) is able to cache documents. It recieves some view result, and downloads only documents with different "_rev" number. I think this is only small change to CouchDB and could be very usefull. Just think about it, please. :-)

Thank you in advance.

Jan.


Re: revision in view

Posted by Mikeal Rogers <mi...@gmail.com>.
A better way to do that kind of cache invalidation would be to use _changes.

Cache the sequence number along with the objects, then do a new
_changes request with since=seq and then keep it open continuously so
you can use the push notifications to update objects on the page and
in the browser in real time :)

http://books.couchdb.org/relax/reference/change-notifications

-Mikeal

On Wed, Feb 17, 2010 at 9:13 AM, Ladislav Thon <la...@gmail.com> wrote:
>> I'm missing only a small feature - add "_rev" field for each document in
>> view result.
>>
>
> Well, you can do it easily yourself, can't you? Just emit doc._rev in your
> view. Or am I missing something in your usecase that prevents it?
>
> LT
>

Re: revision in view

Posted by Ladislav Thon <la...@gmail.com>.
> I'm missing only a small feature - add "_rev" field for each document in
> view result.
>

Well, you can do it easily yourself, can't you? Just emit doc._rev in your
view. Or am I missing something in your usecase that prevents it?

LT

Re: revision in view

Posted by Benoit Chesneau <bc...@gmail.com>.
On Wed, Feb 17, 2010 at 7:31 PM, Mikeal Rogers <mi...@gmail.com> wrote:
> The etag is for the entire query, I think he wants to cache on an doc
> by doc basis for all the docs that were returned for the query. But
> this does remind me that you'll still need to check the etag and the
> query again if there are *new* documents in the query.
>
> -Mikeal
>

well each docs has its own etag corresponding to the rev when you get
it. So it would be enough in this case I guess.

- benoit

Re: revision in view

Posted by Mikeal Rogers <mi...@gmail.com>.
The etag is for the entire query, I think he wants to cache on an doc
by doc basis for all the docs that were returned for the query. But
this does remind me that you'll still need to check the etag and the
query again if there are *new* documents in the query.

-Mikeal

On Wed, Feb 17, 2010 at 10:27 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Wed, Feb 17, 2010 at 4:49 PM, Jan Snasel <ja...@bluepartners.cz> wrote:
>> Hello,
>>
>> You created greate piece of software, indeed. I'm missing only a small feature - add "_rev" field for each document in view result. Imagine situation when client (javascript application in browser window) is able to cache documents. It recieves some view result, and downloads only documents with different "_rev" number. I think this is only small change to CouchDB and could be very usefull. Just think about it, please. :-)
>>
>> Thank you in advance.
>>
>> Jan.
>>
>>
>
> You can just use etags for that.
>

Re: revision in view

Posted by Benoit Chesneau <bc...@gmail.com>.
On Wed, Feb 17, 2010 at 4:49 PM, Jan Snasel <ja...@bluepartners.cz> wrote:
> Hello,
>
> You created greate piece of software, indeed. I'm missing only a small feature - add "_rev" field for each document in view result. Imagine situation when client (javascript application in browser window) is able to cache documents. It recieves some view result, and downloads only documents with different "_rev" number. I think this is only small change to CouchDB and could be very usefull. Just think about it, please. :-)
>
> Thank you in advance.
>
> Jan.
>
>

You can just use etags for that.

Re: revision in view

Posted by Randall Leeds <ra...@gmail.com>.
Emit the _rev from your map function.

On Wed, Feb 17, 2010 at 07:49, Jan Snasel <ja...@bluepartners.cz> wrote:
> Hello,
>
> You created greate piece of software, indeed. I'm missing only a small feature - add "_rev" field for each document in view result. Imagine situation when client (javascript application in browser window) is able to cache documents. It recieves some view result, and downloads only documents with different "_rev" number. I think this is only small change to CouchDB and could be very usefull. Just think about it, please. :-)
>
> Thank you in advance.
>
> Jan.
>
>