Here is my implementation. It failed. What is wrong here?
const pipeline = [
{
$match: {
_id: ObjectId(id)
},
},
{
$lookup: {
from: "comments",
let: {id: "$_id"},
pipeline: [
{
$match:{
$expr: {
$eq: ["movie_id", "$$id"],
},
},
},
{
$sort: { date: -1 },
},
],
as: "comments"
},
},
]