I have a database table which contains documents. These documents have a start and end date. I am trying to only return the documents that are currently active based on todays date (so the start date is either equal or before today, and the end date is either equal or after today). This is the code i have so far
let todaysDate = new Date()
let activeDocuments: any = await this.documentModel.find({"start_date": {$lte: todaysDate} && "end_date": {$gte: todaysDate}})
However, it is bringing up an error with the colon, does anyone know what i'm doing wrong?