My events colleciton stores the following documents:
{
"_id": {
"$oid": "537b2a232a47f21830ae5b7b"
},
"startTime": {
"$date": "2014-05-18T21:00:00.000Z"
},
"endTime": {
"$date": "2014-05-18T23:00:00.000Z"
}
},
{
"_id": {
"$oid": "537af8136c4162d0379e2139"
},
"startTime": {
"$date": "2014-05-19T20:30:00.000Z"
},
"endTime": {
"$date": "2014-05-19T21:30:00.000Z"
}
}
How could I query events by specific startTime in like the following:
var startTime = '2014-05-18T20:00:00.000Z';
db.collection.find({startTime: {$eq: startTime}});
My problem is I need ignore time and use only date in the query. How could I construct my query?