Add time-based indexes to find documents inside of a span or overlapping spans

I have several use cases where I have documents that have a start and end date. And I need to pick out those documents where startDate < Time.now() and Time.now() < endDate. It would be very useful if Fauna had a native way to one-shot query for those documents. Finding the documents where the span of time from startDate to endDate overlaps with another targetStartDate and targetEndDate would be another really useful feature.

One use case is to find currently active leases. They have a start and an end date.

Another use case I have for this are making sure we don’t lease out a property that already has a lease. When creating a new lease, we have to make sure that there are no other leases that the new one will overlap with.

Yet another use case I have is that we have sensors that detect human movement and generate spans when humans enter and leave a space. Given a window of time, I want to select all the spans that are within or overlapping the given window of time.