couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joscha Feth" <>
Subject Re: Limiting views to special users
Date Tue, 29 Dec 2009 22:36:56 GMT
Hi Simon,

Simon Metson wrote:

> > * the results of the view seem to be cached, even though
> > Math.random() may change at each invocation - is this something
> > specific to the temporary views (I used this for testing) or is
> > this the default behaviour?
> That's by design, you calculate a view and store the result because
> potentially that calculation is very expensive/time consuming. When
> you add/delete documents and access the view you calculate a diff of
> the existing view and the changes (that's a grossly simplified view
> of  how it works...). This means that maps with calls to random() and
> date  type functions will not behave as you initially expect (I hit
> this  when playing with dates, the solution I had was to pass the
> date in as  a key arg).

Thanks for that hint!



View raw message