There's a whole bunch of ways to do that... but here are 2: 1. create a map function that emits all the days of the event as keys - the searching for any particular day would yield those events 2. use geocouch, store the start & end dates as a box, then you can use the current date as a bbox to find all events that overlap. Using this method, you'd want to store time as an integer value and not a string.
IMHO #2 is probably a cleaner approach, but requires GeoCouch. - Jim Jim Klo Senior Software Engineer Center for Software Engineering SRI International On Apr 27, 2012, at 11:19 AM, Stephan Bardubitzki wrote: > I have a database of events and since events can be multi-day events all > documents have a start_date and end_date. Now I want to get all events that > happen today and those that are starting in the coming days. > > How should I determine if today is in the range of start_date and end_date? > > To make things more complex an event can be assigned to one or more > categories such as sports, music etc. So the next task would be to get all > events of a certain category that happen today and in the coming days. > > Since a db of events might be a common task I hope someone has already come > up with a solution. > > Any advice would be greatly appreciated. > > Stephan >
smime.p7s
Description: S/MIME cryptographic signature
