Datetimes

When writing a couchdb view you can choose whatever field to emit,  To get a document list in chronological order emit the date field in your view so that a start

View “start_date”

function(doc) {
if(doc.date_start && doc.name)
{
emit(doc.date_start,doc.name);
}
}

Queries:

_view/recent_date?startkey=”2015-02-03″ //Get everything after feb 3 2015

_view/recent_date?startkey=”2015-02-01″&endkey=”2015-03-01″ //Month of Feb

 

 

Your startkey / endkey request must be formatted the same as dates are stored in your database.  I recommend JSON e.g “2015-01-25 T00:00:00Z”