Sort doesn't seem to be working in Get Comments(ticket)

Can someone tell me, what’s wrong here?

{
lookup: { from: 'comments', let: {id: '_id’},
pipeline: [{
$match: {
$expr: { $eq: [’$movie_id’, ‘$$id’] }
}
},
{
$sort: {date: -1}
}
],
as: ‘comments’
}
}emphasized text

Hi @Sant_29827,

When using let in $lookup, you specfiy fields on the right side with $.

Try:

lookup: { from: 'comments', let: {id: '$_id’},

Let me know if you have any questions.

Kanika

@Kanika thanks