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

  • SEARCH
  • Home
  • 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 8807077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:17:11+00:00 2026-06-14T02:17:11+00:00

I have a couple of documents in my couchdb formatted like this: { type:

  • 0

I have a couple of documents in my couchdb formatted like this:

{ type: "event", start: "2012-02-08T19:30+01:00", title: "foo" }

There is a view that lists these documents using start as key. This is because these dates sort naturally:

function (doc) {
  if (doc.type == "event") emit(doc.start, doc)
}

I can then access the next three events by ways of the startkey query parameter: viewname?startkey=\"2012-02-08\"&limit=3

Now I use a list to format this view with some HTML:

function (doc, req) {
  return provides("html", function() {
    // something with getRow() to query the view
  });
}

The current date is dynamic and cannot be specified directly in the map function of the view, but is there a way to set the startkey property in the list function? Before calling getRow() for the first time? Of course I could parse the key and compare it to the current date in the list, but that would invalidate the intentions of the query parameters altogether. Is there a better way?


The backstory

The list URL is actually rewritten from a much nicer URL. I have the following properties in rewrites.json:

{
    "from": "/ausstellungen/rueckblick",
    "to": "_list/rueckblick/exhibitions",
    "query": {
      "startkey": "\"2012-02-08\"",
    "descending": true
  }
}

The date is static, but the parameter should always reflect the current date.

  • 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-06-14T02:17:13+00:00Added an answer on June 14, 2026 at 2:17 am

    No, the only way to do this without simply discarding rows in your _list function based on reading new Date (which would cause caching trouble anyway) would be external to the database: either a smart reverse proxy or by making sure links to the view have the correct startkey. CouchDB’s rewriting does not support JavaScript intervention, and anything past that level you will not be able to modify what data is fetched off of disk.

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

Sidebar

Related Questions

I have a CouchDB database with documents representing 100,000 events. Each event has, among
I have a couple different apps that write text files to the Documents Directory
I have couple of questions about AS3 variables handling by AVM/compiler/scope .1. This code
This query was working for me until recently. I now have 135 InstallationSummary documents
I have indexed a couple of documents using solr, now when I perform a
I have a few questions about git. I have read a couple of documents
There are two questions I have with this latest project: A user will select
I have couple of hyperlinks on my website. What I want is to remove
I have couple of dozen pieces of data that I need to save and
I have couple of formulas and data coming from database. I want to refresh

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.