I am having trouble querying mongodb using user's birth date. The client application is sending birth date as a string in "MM-DD-YYYY" format. I am getting no result although the user is an my database. How do I structure my application query in order to convert date inside a string to ISODate?
Here is the client request
{"firstName": "Mark",
"lastName": "Tony",
"birthDate": "06-25-1990"
}
Here is my query
db.user.findOne({
'firstname': req.body.firstName,
'lastname': req.body.lastName,
'dob': req.body.birthDate
});