Please can anybody help with this MongoDB query?
I wrote this query:
db.getCollection('epg').find({
'programs.start':{'$lte': new ISODate('2015-07-30 19:10:00.000Z')},
'programs.end':{'$gte': new ISODate('2015-07-30 19:10:00.000Z')}},
{'programs.$':1, 'name':1, 'id':1, 'broadcastDay':1})
MongoDB returns me this document:
{
"_id" : ObjectId("55ba36cb68057b06d80f766a"),
"id" : "2",
"broadcastDay" : "2015-07-30",
"name" : "Prima COOL",
"programs" : [
{
"serialNumber" : "11/340/00039/0024",
"start" : ISODate("2015-07-30T19:25:00.000Z"),
"end" : ISODate("2015-07-30T19:44:00.000Z")
}
]
}
Start and end in returned document don't match the query. Does anybody know, why MongoDB returns this document? I expect, that result will be empty (there is no matching document in my collection "epg").