Hi all
I have a question that I would like to get your help with.
I have users documents that have products array. Each product contains ProductID.
In addition, I have products documents.
I want to find all the users that have products that don’t exist in products document.
My query that doesn’t work:
db.users.aggregate([
{
$lookup:
{
from: "prodcuts",
localField: "Products.ProductID",
foreignField: "_id",
as:"resultTest"
}
},
{
$match:
{
eq: { resultTest: [] }
}
}
]