Jeg tror, du kan bruge $hour, $day ... til at opdele datoen i aggregering. For eksempel:
mine data:
db.orders.find()
{ "_id" : ObjectId("5760bf21b05d6825e05fa23d"), "item" : "test1",
"create_at" : ISODate("2016-04-30T11:00:00Z") }
{ "_id" : ObjectId("5760bf30b05d6825e05fa23e"), "item" : "test2",
"create_at" : ISODate("2016-04-30T12:00:00Z") }
{ "_id" : ObjectId("5760bf37b05d6825e05fa23f"), "item" : "test3",
"create_at" : ISODate("2016-04-30T13:00:00Z") }
min forespørgsel:
db.orders.aggregate([{$project:{hour:{$hour:"$create_at"}}},
{$match:{hour:{"$in":[11,12]}}}])
{ "_id" : ObjectId("5760bf21b05d6825e05fa23d"), "hour" : 11 }
{ "_id" : ObjectId("5760bf30b05d6825e05fa23e"), "hour" : 12 }