Is it possible to use $and in combination with some dynamic values when using the find method?
For example:
let { city, zanr, date } = req.body;
const selectedEvent = await Events.find({
$and: [{ address: city}, { type: zanr }, { date: datum }],
});
In some cases, the value "all" might be present in req.body, indicating that no filtering is needed.
Occasionally, the address field may need to be set to "any".