I am new with mongoDB and I need to used $exists with $expr in mongoDB, i tried following:
$lookup: {
as: "collectionDet",
from: "collection",
let: { userId: "$userId" },
pipeline: [{
$match: {
$expr: {
$and: [
{ $eq: ["$_id", "$$userId"]},
{ $eq: ["$status", true], },
{
$or: [
{ $eq: ["$isDeleted", false ], },
{ $exists: ["$isDeleted", false ] },
],
}
],
},
},
}],
}
this is return error like:
"message": "Unrecognized expression '$exists'"
Is there any way to used $exists in $expr or any other alternative available?