I am using the http api to query ravendb (so a LINQ query is not the solution to my question). My Product document looks like this:
{
"editDate": "2012-08-29T15:00:00.846Z"
}
and I have the index:
from doc in docs.Product
select new { doc.editDate }
I want to query all documents before a certain date AND time. I can query on the DATE using this syntax:
editDate: [NULL TO 2012-09-17]
however I can't figure out how to query the time component as well. Any ideas?
You can query that using:
editDate: [NULL TO 2012-09-17T15:00:00.846Z]
If you care for a part of that, use:
editDate: [NULL TO 2012-09-17T15:00]
Note that you might have to escape parts of the query, like so:
editDate: [NULL TO 2012\-09\-17T15\:00]
For this to work you also need to ensure that the field is analysed. In Raven Studio - Add Field -> editDate, and set Indexing to Analyzed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With