How to find documents that is equal or includes today in its date range? Given the date, how can I find and return only documents that are in the range or equal to the start or end date in Mongo DB?

"startDate" : ISODate("2020-01-01T00:00:00.000+0000"), 
"endDate" : ISODate("2020-01-01T00:00:00.000+0000"), 

"startDate" : ISODate("2020-04-24T00:00:00.000+0000"), 
"endDate" : ISODate("2020-05-23T00:00:00.000+0000"), 
.........


Here it is the solution:

$and: [
        { "startDate": { $lte: new ISODate("2020-01-01T00:00:00.000+0000") } }, 
        { "endDate": { $gte: new ISODate("2020-01-01T00:00:00.000+0000") } }
]
Just use ISODate(...) (which is an alias for new Date(...))

You can skip $and, if you like:

{ 
   "startDate": { $lte: ISODate("2020-01-01T00:00:00.000+0000") } ,
   "endDate": { $gte: ISODate("2020-01-01T00:00:00.000+0000") }
}


A more dynamic and easier way would be to use moment.js library:

{
   startDate: { $lte: moment().startOf('day').toDate() },
   endDate: { $gte: moment().startOf('day').toDate() }
}