Howto create an index for date range

I would need to be able to get documents based on them being "active". A document is active if its online and "now" is between the start and stop date.

e.g.
{
online:true,
startDate:"2014-01-01",
stopDate:"2014-01-10"
...
}
so ideally I want the above document to be listed in a view between the dates given so i know all items in the view are ok to show online e.g. in a listing web page.

But you cant use views like this as they are only computed upon document insert and update.

What is the best way of doing something like this?

0 Answers

No answers yet