I need to select documents with "entryDateTime" between two given dates => minDate, maxDate. This is my "find" method:
var cursor = db.collection('Invoices').find({'workplace': String(client._id)});
I found that mongodb stores the date as a STRING:
2017-05-26T21:00:00.000Z
Yet the minDate and maxDate are of Date type. When I try to convert them to String, it won't work (always returns "true").
How can I select only the documents with "entryDateTime" between those two dates?
I'm working with Nodejs.
I have found another question where the date is stored like that: "Sun May 30 18:47:06 +0000 2010". I'm not sure about the difference between the two ways these dates are stored.