Edited for better explanation:
i have a lot of entries throughout all the day
Documents in my collection are like this:
{
"type": "Watches",
"timestamp": ISODate("2016-02-23T21:00:00.000Z"),
"price": 100.77
}
{
"type": "Watches",
"timestamp": ISODate("2016-02-23T20:50:00.000Z"),
"price": 200.77
}
{
"type": "Watches",
"timestamp": ISODate("2016-02-24T21:00:00.000Z"),
"price": 300.77
}
{
"type": "Watches",
"timestamp": ISODate("2016-02-24T20:51:00.000Z"),
"price": 94.77
}
The entries are saved in minutes. But, some days there are NOT entries at all.
So, how can i search all the entries at 21:00 until get 10 results? (skipping the days that there are not entries)
my first try was making an array like:
var array_of_dates =[ Thu Feb 24 2016 21:00:00 GMT-0300 (ART),
Wed Feb 23 2016 21:00:00 GMT-0300 (ART) ]
and use it with { '$in' : array_of_dates } but, if some days that there are not entris, i get less than 10 results.