Hello @schach_schach,
The $match
can’t allow checking the internal fields condition directly, you need to use $expr operator, $not
and $in
operator to match your condition,
db.collection.aggregate([
{
$match: {
$expr: {
$not: {
$in: ["$_id", "$applications.firstTimeInstalled.refId"]
}
}
}
}
])