Suppose the sample documents in Mongodb database are as follows:
{ "date" : ISODate("2015-11-09T05:58:19.474Z") }
{ "date" : ISODate("2014-10-25T07:30:00.241Z") }
{ "date" : ISODate("2015-11-30T15:24:00.251Z") }
{ "date" : ISODate("2012-01-10T18:36:00.101Z") }
Expected:
{ "date" : ISODate("2015-11-09T05:58:19.474Z") }
{ "date" : ISODate("2014-10-25T07:30:00.241Z") }
Iam interested in finding the documents whose time in "date" field is between 04:00 and 08:00 irrespective of day,month and year. Indirectly query has to match any "YYYY-MM-DDT" in date field.
My approach would be, query all the documents within presumed duration of dates from node and then for each document that matched the query, compare the "date&#