How do you query the ravendb index containing dates using Lucene?

I use http api for ravendb request (so LINQ request is not a solution to my question). The My Product document is as follows:

{
  "editDate": "2012-08-29T15:00:00.846Z"
}

and I have an index:

from doc in docs.Product
select new { doc.editDate }

I want to request all documents up to a specific date and time. I can query DATE using this syntax:

editDate: [NULL TO 2012-09-17]

However, I cannot figure out how to query the time component. Any ideas?

+5
source share
2 answers

You can request this using:

 editDate: [NULL TO 2012-09-17T15:00:00.846Z]

If you are interested in part of this, use:

 editDate: [NULL TO 2012-09-17T15:00]

Note that you may need to avoid part of the request, for example:

 editDate: [NULL TO 2012\-09\-17T15\:00]

, . Raven Studio - β†’ editDate .

+5

- , unix.

, .

javascript js- :

{
  "editDate": "2012-08-29T15:00:00.846Z",
  "editDateUnix": moment("2012-08-29T15:00:00.846Z").unix()
}

:

from doc in docs.Product
select new { doc.editDate, doc.editDateUnix }

lucene:

"editDate: [NULL TO "+moment("2012-09-17").unix()+"]"
-1

All Articles