Hello,
I would like to know if I have to create index for nested array object field (replyToId) if I use it only together with $project and $filter;
for example:
{
$project: {
_id: 1,
replies: {
$filter: {
input: `$comments`,
as: 'comment',
cond: {
$eq: [`$$comment.replyToId`, new ObjectId(data.commentId)],
},
},
},
},
},