I just want to set some conditions in Mongoose find() to query from my Routine model. Is it possible in any way? or How to set such kind of custom conditions?
const List = await Routine.find({
$where:
() => {
moment(currentDate).isBetween(this.startDate, this.endDate, undefined, '[]') == true &&
customFunc(this) == true
}
})
Where the customFunc() returns a boolean value