Query to $unwind $group and $match with mongo db

Could you please mark your other related thread as solved before doing a followup post?

To get only specific elements of an array, use $filter rather than $unwind and $group. That is much more efficient.

But if you only $filter to get a sum on the filtered element, you should be using $reduce as proposed in your other thread.