Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5843747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:11:50+00:00 2026-05-22T12:11:50+00:00

Contrived example: { productName: ‘Lost Series 67 DVD’, availableFrom: ’19/May/2011′, availableTo: ’19/Sep/2011′ } View

  • 0

Contrived example:

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

View storeFront/currentlyAvailableProducts basically checks if current datetime is within availableFrom – availableTo and emits the doc.

I would like to force a view to regenerate at 1am every night, i.e. process/map all docs.

At first I had a simple python script scheduled via crontab that touched each document hence causing a new revision and the view to update,however since couchdb is append only this wasnt very efficient – i.e. loads of unnecessary IO and disk space usage followed by compaction, very resource wasteful on all fronts.

Second solution was to push the view definition again via couchapp push however this meant the view was unavailable (or partially unavailable) for several minutes which was also unacceptable.

Is there any other solutions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:11:51+00:00Added an answer on May 22, 2026 at 12:11 pm

    So your view is not being updated automatically I take it?

    New and changed documents are not being added on the fly?

    Oh I see, you’re cheating. You’re using “out of document” information (i.e. the current date) during view creation.

    There’s no view renaming, but if you were desperate you could use url rewriting.

    Simply create a design document “each day”: /db/_design/today05172011

    Then use some url rewriting to change: GET /db/_design/today/_view/yourview

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

    Create the view at 11pm server time (tweak it so that “now” is “tomorrow”, or whatever).

    Then add some more clean up code to later delete the older views.

    This way your view builds each night as you like.

    Obviously you’ll need to front Couch with some other web server/proxy to pull this off.

    It’s elegant, and inelegant, at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem like a somewhat contrived example, but I'm left scratching my head.
Here's a contrived example: I want to divide two numbers and I need to
I have a page (contrived example below) with a Google doc and a download
To use a contrived example in Java, here's the code: enum Commands{ Save(S); File(F);
This is a contrived example, but it illustrates my problem much more concisely then
In the following contrived example, data is given a warning due to it being
Here's a contrived example of my code: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
I'm using Mongoosejs to connect with MongoDB. Consider the following contrived example of a
Consider this contrived, trivial example: var foo = new byte[] {246, 127}; var bar
A contrived example: signature A = sig type t val x: t end signature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.