skip to Main Content

Search mongodb data using the lt & gt comparators on the date

const queryMatch = {departureDate: {$gte: new Date(query.departureDateMin),$lte: new Date(query.departureDateMax)}}; const flightsByCriteria = await this.flightModel.find(queryMatch).exec(); The above request returns an empty table. And yet I get data with mongodbCompass using ISODate(dateString) instead of new Date(dateString) I don't know where the problem…

VIEW QUESTION
Back To Top
Search