2009/4/19 Wout Mertens <[email protected]>: > On Apr 19, 2009, at 7:46 PM, Elf wrote: > >> 2009/4/19 Wout Mertens <[email protected]>: >>> >>> On Apr 19, 2009, at 1:56 PM, Elf wrote: >>> >>>> So, i have something like in view: >>>> >>>> if (doc.date_check < (new Date().getTime()/1000 - 2*60*60)) { >>>> emit('not checked', 1); >>>> } >>>> >>>> As I understand, it's impossible to cache this view results, so this >>>> view must be recounted on every call. >>>> Am i right? >>> >>> No. >>> >>> This view will be calculated once and then the result is what it was >>> until >>> the document is changed and the view recalculated. >> >> So, only first view calculating will be correct (new Date() returns >> current date) and all next calls to this view will return incorrect >> rows (because of outdate new Date() value in a view)? > > Yup... View functions have to be such that given a view function f and 2 > documents x and y, that if x == y then f(x) == f(y). >
Ok, I understand. I'll change program logick to adopt couchdb reality. CouchDB is amazing, but need to put upside down all i know before about databases... -- ---------------- Best regards Elf mailto:[email protected]
