Currently, I am working on a query that involves using $and to apply multiple filters or conditions. While explaining the query, I realized that $and does not function in the same way as the JavaScript && operator. How can I simulate JavaScript && functionality in a MongoDB query?
MyModel.aggregate([{
$match: {
$and: [{
$text: {
$search: mappedSearchTxt
}
}, ...regexFilter, ...filters]
}
}])