I have a request variable defined and for some reason I cannot use it in the $in block:
{
$lookup: {
from: 'users',
as: 'user',
let: {
"blogIds": "$blog.id"
},
pipeline: [{
$project: {
id: 1,
user_name: 1,
picture: 1,
blogs: 1
},
},
{
$match: {
blogs: {
$in: ["$$blogIds"]
}
}
},
]
}
}
What am I doing wrong?
if i try to send without $match, but with `$addFields:
{
$lookup: {
from: 'users',
as: 'user',
let: {
"blogIds": "$blog.id"
},
pipeline: [{
$project: {
id: 1,
user_name: 1,
picture: 1,
blogs: 1
},
},
{
$addFields: {
field: "$$blogIds"
}
},
]
}
}
Document example:
lorem ipsum dolor amen.

