CouchDB Image Regeneration

A simplified example:

{
  productName: 'Lost Series 67 DVD',
  availableFrom: '19/May/2011',
  availableTo: '19/Sep/2011'
}

Browse storeFront / nowAvailableProducts basically checks to see if the current time and time is within reach. From - availableTo and emits a document.

I would like to force the view to be updated from 1 am every night, i.e. process / display all documents.

At first I had a simple python script planned through crontab that touched each document, which caused a new revision and view for updating, however, since couchdb is added, this is not very efficient - that is, loads of unnecessary I / O and disk space followed by compaction very resource intensive on all fronts.

The second solution was to click the definition of the view again using kuchapping, however, this meant that the view was unavailable (or partially unavailable) for several minutes, which was also unacceptable.

Are there any other solutions?

+3
source share
2 answers

So, your view is not updated automatically? Do I accept it?

New and changed documents are not added on the fly?

Oh, I see you are cheating. You use information "outside the document" (that is, the current date) when creating the view.

There is no view renaming, but if you were desperate to use URL rewriting,

Just create the project document "every day": / db / _design / today05172011

URL : GET/db/_design/today/_view/yourview

to: GET/db/_design/today051711/_view/yourview

11:00 ( , "" "" - ).

, .

, , .

, Couch -/-, .

, .

+2

; , :

-

, , .

, (), . , 19 21 (), :

"2011-05-19"
"2011-05-20"
"2011-05-21"

, , , (, ) ?key="2011-05-18".

.

- URL- , _show 302 () .

+6

All Articles