I have two fields in my collection like below
{
"StartDate" : "1/2/2019",
"EndDate" : "5/14/2019"
}
i want to write a find query to get the documents with in current date
example db.collection.find({StartDate:{$lte: '5/9/2019'},EndDate:{$gte:'5/10/2019'}})
but here '5/14/2019' >= '5/9/2019' this condition is returning false '5/14/2019' >= '5/9/2019' this is returning true
I don't understand why it is happening I cannot use MM/DD/YY format I have to stick to M/D/YYYY format
please provide me with a better solution thanks in advance