I am trying to query a collection based on a date field. My collection has a field of type date+time stamp. However I would like to ignore the time stamp and just use the date portion. The field is : "enddate" : ISODate("2014-10-10T07:00:00Z"). I am using the following query:
Camps.findOne(
{ $and: [ {status: 1} , {camp_id: pCampID} , {$or: [ {enddate: null}, {enddate: {$gte: new Date()} } ] } ] },...
but date (new Date()) is converted to UTC date which causes the query not to return all the documents.
Any help is greatly appreciated.